how to loop through table?
-
How do i loop through a table. I am using asp.net with (VB). i know how to create the loop just not how to call the table and its rows and cells what is the syntax for that? Thank you, Santana
Hi, You could do this using foreach loop as DataTable has a collection of DataRows. To do this... foreach (DataRow dr in DataSet1.Tables["myTable"].Rows) { //To access the values in each row use 'dr' as this is the DataRow in //subject to each loop. } Hope that helps. ~~~~~~~~~~~~~~~~~~~~~~~~ Shravan Addaypally .NET Apps Developer BellSouth Billing Inc. Birmingham, AL 35205 ~~~~~~~~~~~~~~~~~~~~~~~~
-
Hi, You could do this using foreach loop as DataTable has a collection of DataRows. To do this... foreach (DataRow dr in DataSet1.Tables["myTable"].Rows) { //To access the values in each row use 'dr' as this is the DataRow in //subject to each loop. } Hope that helps. ~~~~~~~~~~~~~~~~~~~~~~~~ Shravan Addaypally .NET Apps Developer BellSouth Billing Inc. Birmingham, AL 35205 ~~~~~~~~~~~~~~~~~~~~~~~~
-
How do i loop through a table. I am using asp.net with (VB). i know how to create the loop just not how to call the table and its rows and cells what is the syntax for that? Thank you, Santana
-
Make the table as a server control and ... use the Innerhtml and innertext properties for ur use ... Regards, Prakash Kalakoti
-
do you happen to have an example? I just need to know the right format/syntax. thank you Santana
-
Create a server side table like this Now you should be able to access any cell/Row using the index Table1.Rows(0) Table1.Rows(0).Cells(1)