DataAdapter and DataSet in Disconnected Mode

  • Thread starter Thread starter A K
  • Start date Start date
A

A K

I am new to ADO.Net and trying to use DataAdapter & DataSet.

I read the data from database table into dataset using DataAdapter.

Do I have to use the same DataAdapter object to update and commit the
changes made to DataSet?

I will appreciate any pointers to articles / documentations.

Regards,

Abdul
 
A said:
I am new to ADO.Net and trying to use DataAdapter & DataSet.

I read the data from database table into dataset using DataAdapter.

Do I have to use the same DataAdapter object to update and commit the
changes made to DataSet?

I will appreciate any pointers to articles / documentations.

Regards,

Abdul
Yes, you should use the same DataAdapter.

Here's a link that describes the process:
http://msdn2.microsoft.com/en-us/library/y2ad8t9c(VS.71).aspx
 
Do you have to? No.
Shoud you? It is easier in many instances.

Whether you use a single adapter or more than one, you still end up having
to account for concurrency. Dino Esposito wrote some excellent articles on
concurrency in ADO.NET, so a google search will help. If you are using
auto-generated stuff (for INSERT, UPDATE), you will have to set up identical
adapters, if you choose more than one; in this instance, a single adapter is
better.

The adapter is just a bridge between the DataSet and the database, so you
are free to build other bridges, if it makes sense. In most "single
application" scenarios, you are just creating extra work, but there are
cases where one app pulls and the other pushes. Can't think of one off hand,
but it is possible. In this instance, you will either have the adapter in
its own library (smart) or code two.

--
Gregory A. Beamer
MVP, MCP: +I, SE, SD, DBA

*************************************************
| Think outside the box!
|
*************************************************
 
Cowboy (Gregory A. Beamer) said:
Do you have to? No.
Shoud you? It is easier in many instances.

Whether you use a single adapter or more than one, you still end up having to account for concurrency. Dino
Esposito wrote some excellent articles on concurrency in ADO.NET, so a google search will help. If you are using
auto-generated stuff (for INSERT, UPDATE), you will have to set up identical adapters, if you choose more than
one; in this instance, a single adapter is better.

The adapter is just a bridge between the DataSet and the database, so you are free to build other bridges, if it
makes sense. In most "single application" scenarios, you are just creating extra work, but there are cases where
one app pulls and the other pushes. Can't think of one off hand, but it is possible. In this instance, you will
either have the adapter in its own library (smart) or code two.

--
Gregory A. Beamer
MVP, MCP: +I, SE, SD, DBA

*************************************************
| Think outside the box! |
*************************************************


http://www.knowdotnet.com/articles/datasetmerge.html
 
Back
Top