Sign In| Join
Get Help:Ask a Question in our Forums|Report a Bug|More Help Resources
Star
8714 Points
1624 Posts
May 07, 2012 01:36 PM|LINK
Hi , To loop thru the Datatable, here is the sample code which can help:
DataTable table = GetTable(); // Get the data table. foreach (DataRow row in table.Rows) // Loop over the rows. { Console.WriteLine("--- Row ---"); // Print separator. foreach (var item in row.ItemArray) // Loop over the items. { Console.Write("Item: "); // Print label. Console.WriteLine(item); // Invokes ToString abstract method. } }
Hope this will help !!!
sandy060583
Star
8714 Points
1624 Posts
Re: Looping thorough a query and storing the row values in a Dictonary or someother object
May 07, 2012 01:36 PM|LINK
Hi , To loop thru the Datatable, here is the sample code which can help:
DataTable table = GetTable(); // Get the data table. foreach (DataRow row in table.Rows) // Loop over the rows. { Console.WriteLine("--- Row ---"); // Print separator. foreach (var item in row.ItemArray) // Loop over the items. { Console.Write("Item: "); // Print label. Console.WriteLine(item); // Invokes ToString abstract method. } }Hope this will help !!!
Ramani Sandeep (My Blog)
(MCTS, MCC-2011)