PC Review
Forums
Newsgroups
Microsoft DotNet
Microsoft ADO .NET
Retrieving data directly from a table adapter
Forums
Newsgroups
Microsoft DotNet
Microsoft ADO .NET
Retrieving data directly from a table adapter
![]() |
Retrieving data directly from a table adapter |
|
|
Thread Tools | Rate Thread |
|
|
#1 |
|
Guest
Posts: n/a
|
In working with ADO.NET in VS2005, I need to find specific rows in the filled
adapter and get values from specific columns in those rows. To do this, I first have to query the table adapter's binding source: bs1.find("datafield",value to find in the datafield) then I need an integer to store the position of the returned row: intPos = bs1.position Then I can retrieve data from the table adapter: ?me.ta1.GetData.Item(intpos).Item(2).ToString The only way to get the information is using the ToString property, so I have to convert any returned value that is not a string back to its actual data type (number, date, etc.) In addition, the find only works with one column value, so I can't find a row or rows in the datatable based on multiple columns. Last, if the find returns multiple rows, I only get the position of the first one. There must be a better way... |
|
![]() |
|
| Thread Tools | |
| Rate This Thread | |
|
|

Main Page 

