Tim Maxey .NET Technology Blog & Resources

For Loop in C#

Wanted to post a for loop in a dataset, I will post the dataset function as well...

foreach (DataRow dr in ds.Tables[0].Rows)
            {
                //do something with the data
                if (dr["Field1"] = 1)
                {
                      //do something
                }
                else if (dr["Field2"] = 1)
                {
                      //do something
                }
                else if (dr["Field3"] = 1)
                {
                      //do something
                }
               
            }


Feedback

No comments posted yet.


Post a comment





 

Please add 2 and 2 and type the answer here: