views:

1311

answers:

4

Hi

I want to retrieve identity column value after running Insert or Update (using Access DB in C#). How can I do it?

i use a Typed dataset to fill and update...

+3  A: 

For retrieving the identity of inserted rows see this link:

http://msdn.microsoft.com/en-us/library/ks9f57t0%28VS.80%29.aspx

This link describes how to find the value of an inserted row in SQL, you then need to return that row in a SELECT statement (as Access does not support return parameters)

You may also be interested in this question, which compares the different methods of returning the identity.

http://stackoverflow.com/questions/42648/best-way-to-get-identity-of-inserted-row

Kragen
+1  A: 

Ms-Access C# connectivity for insertion deletion updation for identity column

Tutorial

Shantanu Gupta
there is no partial class subject already :)
serhio
plz attention to my question.i want get identity code in access database after information save
hosseinsinohe
@hosseinsinohe: plz post your questions to be clear ones for everybody. First of all think WHAT exactly you want and then edit a question...
serhio
@hosseinsinohe should i consider that you dont want to implement partial class at this point ?
Shantanu Gupta
I want get Auto-Increment Column Value after insert or update database. i use 'Typed Dataset' And 'Access DataBase'.I can not write En very wellplz help me
hosseinsinohe
@hosseinsinohe sry then i dont know about typed dataset. U need to modify your question then, along with title. Modify your question with this comment that u wrote now
Shantanu Gupta
A: 

(sorry I cannot post a comment)
It sounds to me like he is using an ADO.net DataSet, and wants to retrieve an the value of an auto-increment column after inserting a value.
I don't know where you are all getting partial classes from, he's saying he can't figure out how to do it in C#, not that he doesn't want it in C#.

BlueRaja - Danny Pflughoeft
okthats rightplz help me
hosseinsinohe
@BlueRaja Now the title has been edited by him. B4 that title had implementing partial class also
Shantanu Gupta
ah my apologies then
BlueRaja - Danny Pflughoeft
A: 

Hi My Freind

In Find answer of My Question

the Flowing Links Helped me to write a partial Class to Validate Rows in Dataset And Write a Code to Recive a AutoIncrement Column Value:

http://msdn.microsoft.com/en-us/library/ms171896(VS.80).aspx

http://msdn.microsoft.com/en-us/library/0f7ey06d(VS.80).aspx

http://msdn.microsoft.com/en-us/library/1120xds5(VS.80).aspx

thank you

hosseinsinohe