Re: Strongly typed dataset and transactions
- From: "James Minns" <minns@xxxxxxxxxxxxxxxxxx>
- Date: Mon, 12 Jun 2006 01:02:01 +0200
The problem is that the automatically generated TableAdapter from the xsd
file, whilst derived from a standard TableAdapter, does not give you access
to the InsertCommand, so you cannot set its transaction!
I'm clear on parent/child records, and I know that SQL server has countless
advantages but I'm stuck with a Jet database for this project.
I can certainly use transactions with a normal TableAdapter, it just seems
stange that MS automatically generates these custom TableAdapters, then
makes is very difficult to use transactions, essential for all but the most
trivial databases.
James
"Cowboy (Gregory A. Beamer)" <NoSpamMgbworld@xxxxxxxxxxxxxxxxxx> wrote in
message news:ewXzC9ZjGHA.1552@xxxxxxxxxxxxxxxxxxxxxxx
The DataSet, itself, whether typed or not, is a container. The Adapter
(DataAdapter, TableAdapter, etc.) is the bridge from the container to your
persistent source (it can actually get more complex than this, but that is
a good start).
The easiest system I have seen is to set up your DataSets with an ordering
attribute and then fire back so each sproc is fired in order to guarantee
parent records are inserted prior to child records. You can wrap all of
the adapters in a transaction and roll back.
Another option is XML input into a stored procedure, but I am not sure
this is the best option with Access, as I am not well versed enough to
know what XML it currently supports.
The third option is roll your own data layer. With SQL Server and other
full RDBMS products, this is easier than Access, as well.
Hope this gives you some useful hints.
--
Gregory A. Beamer
*************************************************
Think Outside the Box!
*************************************************
"James Minns" <minns@xxxxxxxxxxxxxxxxxx> wrote in message
news:%23gN0zlZjGHA.4660@xxxxxxxxxxxxxxxxxxxxxxx
Hi all,
I am using VB.NET (2005) to write to an Access database, with oledb.
I have created strongly typed datasets in an xsd file to read from and
update several tables in the database.
I would like to use a transaction so that in case the update of one table
fails, I can roll back the updates made to another table, and here lies
the problem.
I can't see how to access the insert/update/delete command for the
strongly typed dataset so I can set the transaction property - The
problem does not arise when using a standard TableAdapter!
Any ideas?
Thanks, James
.
- References:
- Strongly typed dataset and transactions
- From: James Minns
- Re: Strongly typed dataset and transactions
- From: Cowboy \(Gregory A. Beamer\)
- Strongly typed dataset and transactions
- Prev by Date: Re: Strongly typed dataset and transactions
- Next by Date: Re: Migration from ADO to ADO.Net with SqlClient
- Previous by thread: Re: Strongly typed dataset and transactions
- Next by thread: Re: Strongly typed dataset and transactions
- Index(es):
Relevant Pages
|
|