DB Queries

  • Thread starter Thread starter Kerry gracefield
  • Start date Start date
K

Kerry gracefield

Hi,

i wanted to find out how i can create another sql command
withing the same connection. Currently i have a datagrid
on a page that pulls all the coloumns from a table. What
i want is another query on the same page to do some other
functions. do i need to add and configure anothe
OLEDBDataAdapter?? do i need to creat another connection?
i want to access the query builder for my new query.

plz can anyone assist me on this.
Im using VB.net with an access DB.
 
Hi,
You can use multiple dataadapters using the same
Connection object. You can use one Dataadapter for all
your tables in the dataset by changing in and out the
Command objects in the SelectCommand, InsertCommand, Etc.
properties or use a separate dataadapter for each separate
table loaded into the dataset. In most cases I prefer a
separate dataadapter for each table in the dataset, but it
depends on what you are doing.

Using dataadapters for filling dataset objects or updating
the database from dataset objects is independent of what
source you bind your controls to in the dataset. When you
bind controls, the communication of data is strictly
between the control and its source in the dataset, which
is disconnected from the database. When you are ready to
update the database, then you need to make sure that
whatever dataadapter object(s) you use, has the
appropriate command object properties to update the
database from the object(s)in the dataset.

I hope this works for you. My email address has only
2 "k"s in it.

Carol
 
Back
Top