Click here to Skip to main content
15,892,805 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hi All,

I'm wondering if this is possible. I want to have a specific function be called for every 10th item in the dataset.

For example:

1, 2, 3, 4, 5, 6, 7, 8, 9, 10, (Call Function), 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, (Call Function)

Is this possible? This is probably a very simple piece of code, but I cannot seem to figure it out.

Regards,
Chris
Posted

1 solution

Tried anything?

It has nothing to do with dataset or c# for that matter. It's basic arithmetic.

Anyway, you can start something like this:

C#
for (int count = 1; count <= 100; count++)
{
    if((count % 10) == 0)
    {
        Console.WriteLine(count);

        //Call your function here...
    }
}
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900