Multiple select statements with a dataadapter

G

Guest

I'm wondering if there is a limit of a single select, delete and insert statement (command) to each dataadapter? On a form, I have a dataconnection that is shared by 3 dataadapters, one for each of three tables in an Access database. Each was created in the form designer and each has a datatable that was generated in the designer. I have no problem filling the datatables and inserting the rows into the Access tables. I DO need to select the highest identifying number for each successive use of the form to continue with the ID scheme. Do I create
a separate dataadapter for that select statement, do I move the value of the dataadapter's command string back and forth between the two select statements for that table, or can I use the dataadapter that already exists with more than one select statement?
 
M

Mohamoss

Hi Harry
No need to change the command text back and forth . the select command of
the DataAdapter is just a command object . you can change that object
reference along your problem .
Lets say for example that you have tree select command object cmd1 , cmd2
, and cmd3
You also have an adapter object Adp You can have this snippet of code
Adp.SelectCommand = cmd1 ;
// do the selection or whatever update to your datasource
// then
Asp.SelectCommand = cmd2 ; // switch to use another command
hope that helps
Mohamed Mahfouz
MEA Developer Support Center
ITworx on behalf of Microsoft EMEA GTSC
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top