TableAdapter

q1w2e3r4t7

Active member
Joined
Nov 15, 2005
Messages
30
When you use a DataSource in VS.05, it creates a DataTableAdapter in the [datasource] components part of your toolbox.
THis is great, as it already has all the tables, connection string etc.

However, if i want to retrieve only one record from the table rather than the entire table, how can i adjust the select command so taht i can add something like " ... where ID = 123" ? (this is something you could do by adjusting the select command of a normal oledbDataAdapter

Also am i wise to use the update method of the adapter or should i be performing the update another way?


Thanks
 
If you right click on the DataTable in the designer you have the option of adding additional queries into the table adapter, if you use a parametersied bit of SQL it will even generate a strongly typed function for calling the SQL.
 
Thanks.

Can this adjustment be done in code at run time?
im wanting to adjust the adapter at run time so as to retrieve certain results based on a particular field.

I know this can be done by writing my own dataadapter, however i would like if i can adjust the code on the adapter component at run to try change its select statement.


Thanks
 
Back
Top