Having problems with syntax for looping through datarows in a datatable
Posted on 2006-06-19
I for some reason am having a small problem with the syntax for looping through datarows in a datatable.
say the dataset is "mydataset" and the table in the dataset is called "mydatatable"
My code looks like the following:
for each dr as datarow in mydataset.mydatatable
However vs2005 keeps automatically making it look like:
for each dr as datarow in mydataset.mydatatableRow
It keeps adding that "Row" to the end of it. And I am new to asp.net but I am pretty sure that "mydatatable" is setup as a datatable.
The way I set this up is by adding a new dataset under the app_code folder in my site, and then used the tableadapter configuration wizard to make a datatable. At least that is my understanding of what I have done. And I know that the tableadapter works correctly with my connection string because I can use the same datatable (or tableadapter... I am confused on any difference if any) with an objectdatasource and fill a gridview.