D
djc
I read David Sceppa's ADO.NET book, and in particular I have read his
methods for retrieving timestamp and autoincrement values from both sql and
access databases... I am using his method accept that in my simple insert
scenario I am not using a dataAdapter and a Dataset, and therefor no
rowUpdating event either. I am just using my own queries. I want to verify
that what I am doing is ok... more precisely, I want to verify that I did
not break some kind of 'glue' that his exact example used. I need to make
sure that if multiple users were using the app that the autoincrement values
I am retrieving to create child records would remain accurate. I think they
would since I'm using the same connection object for both commands... hope
I'm right : )
heres what I'm doing. Please let me know if its ok.
1) define first insert command and parameters.
2) define the second command to get identity (select @@identity) using same
connection as the first insert command.
3) open connection.
4) execute insert command.
5) execute get identity comand and store value in a variable.
6) define insert command for the child records using the indentity
retrieved.
7) execute insert command for child records.
any info is appreciated. Thanks.
I would highly reccomend David Sceppa's book on ADO.NET. Its a Microsoft
Press book. Very thorough and clear explanations and examples.
methods for retrieving timestamp and autoincrement values from both sql and
access databases... I am using his method accept that in my simple insert
scenario I am not using a dataAdapter and a Dataset, and therefor no
rowUpdating event either. I am just using my own queries. I want to verify
that what I am doing is ok... more precisely, I want to verify that I did
not break some kind of 'glue' that his exact example used. I need to make
sure that if multiple users were using the app that the autoincrement values
I am retrieving to create child records would remain accurate. I think they
would since I'm using the same connection object for both commands... hope
I'm right : )
heres what I'm doing. Please let me know if its ok.
1) define first insert command and parameters.
2) define the second command to get identity (select @@identity) using same
connection as the first insert command.
3) open connection.
4) execute insert command.
5) execute get identity comand and store value in a variable.
6) define insert command for the child records using the indentity
retrieved.
7) execute insert command for child records.
any info is appreciated. Thanks.
I would highly reccomend David Sceppa's book on ADO.NET. Its a Microsoft
Press book. Very thorough and clear explanations and examples.