|
 |
ado_dotnet thread: How to retrive value of Identity field when adding new record form Dataset back to SQL Server
Message #1 by saifulgani@h... on Thu, 2 May 2002 19:10:12
|
|
Hello Friendz,
I am using SQL Sever 7.0 as database.
I have a Table with its Identity field as Primary Key.
I can populate a Dataset with table values using
DataAdapter and SelectCommand objects.
After adding new rows to the Table object, I can save the new values
back into the database using InsertCommand.
However after entering the new values, how can I retrive the value of
Itentity field for the new rows in my Dataset.
The value of Identity Field is alloted by the SQL Server for new rows,
so is there any way to retive these new values in the dataset,
immediately after insertion.
Please help me out,
Saif.
Message #2 by Imar Spaanjaars <Imar@S...> on Thu, 02 May 2002 21:12:17 +0200
|
|
Hi there,
You may be interested in the following KB article.
It's not 100% what you are looking for, but it might push you in the right
direction.
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpguide/html/cpconretrievingidentityorautonumbervalues.asp
HtH
Imar
At 07:10 PM 5/2/2002 +0000, you wrote:
>Hello Friendz,
>
>I am using SQL Sever 7.0 as database.
>I have a Table with its Identity field as Primary Key.
>
>I can populate a Dataset with table values using
>DataAdapter and SelectCommand objects.
>
>After adding new rows to the Table object, I can save the new values
>back into the database using InsertCommand.
>
>However after entering the new values, how can I retrive the value of
>Itentity field for the new rows in my Dataset.
>
>The value of Identity Field is alloted by the SQL Server for new rows,
>so is there any way to retive these new values in the dataset,
>immediately after insertion.
>
>Please help me out,
>Saif.
|
|
 |