q1w2e3r4t7 Posted June 26, 2007 Posted June 26, 2007 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 Quote
Administrators PlausiblyDamp Posted June 26, 2007 Administrators Posted June 26, 2007 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. Quote Posting Guidelines FAQ Post Formatting Intellectuals solve problems; geniuses prevent them. -- Albert Einstein
q1w2e3r4t7 Posted June 27, 2007 Author Posted June 27, 2007 Thanks. Can this adjustment be done in code at run time? i'm 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 it's select statement. Thanks Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.