DataSet Transactions Help
- From: "Brian Scott" <Brian@xxxxxxxxxxxxxxxxxxxx>
- Date: Tue, 12 Apr 2005 16:04:08 +0100
I currently have a defined Datalayer in a C# application which is filled
with data on startup. All forms in the system bind the to this dataset data
source. The datatables within the dataset have various datarelations setup
and as most of the table keys are Identity fields I had to write stored
procedures on the server to return the new identity upon insert. This
required creating a new SqlCommand object that points at the stored
procedure and setting the Dataadpter insert command to this.
The issue is that because I had to write specific stored procedures due to
using Identity fields I now get an exception when I dont attach the
transaction to the other Dataadapter commands such as its Read, Delete and
Update commands. But these are never set and I thereby get a null reference
exception. I do not wish to create these other commands manually, only the
insert as I need the identity to come back out of the SQL Server upon
insert.
How do I implement Transactions on Dataset inserts where the datatable
contains an Identity field?
Thanks.
.
- Follow-Ups:
- RE: DataSet Transactions Help
- From: John Papa
- RE: DataSet Transactions Help
- Prev by Date: RE: Merge DataTable Rows into Second DataTable
- Next by Date: Re: Transaction Scope
- Previous by thread: Stored procedure / .NET woes
- Next by thread: RE: DataSet Transactions Help
- Index(es):
Relevant Pages
|
Loading