1

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...

Hossein Moradinia
  • 6,116
  • 14
  • 59
  • 85
  • 3
    We're going to need much better details of what you're trying to accomplish and how before we can help. – Justin Niessner Jan 05 '10 at 14:28
  • please elaborate your question. IMHO is any link between partial class and id obtaining. – serhio Jan 05 '10 at 14:30
  • finally, the question should be like **"I want to retrieve identity column value after running Insert or Update (using Access DB in C#). How can I do it?"** – serhio Jan 05 '10 at 14:46
  • I think you are trying to ask to Question. 1. How to implement partial class in C#. 2. How to implement insertion, deletion and updation in MS-Access – Shantanu Gupta Jan 05 '10 at 14:52

4 Answers4

5

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.

Best way to get identity of inserted row?

Community
  • 1
  • 1
Justin
  • 84,773
  • 49
  • 224
  • 367
1

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

Tutorial

Shantanu Gupta
  • 20,688
  • 54
  • 182
  • 286
  • plz attention to my question. i want get identity code in access database after information save – Hossein Moradinia Jan 05 '10 at 14:50
  • @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 Jan 05 '10 at 14:52
  • @hosseinsinohe should i consider that you dont want to implement partial class at this point ? – Shantanu Gupta Jan 05 '10 at 14:53
  • 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 well plz help me – Hossein Moradinia Jan 05 '10 at 15:27
  • @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 Jan 05 '10 at 16:09
1

(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
  • 84,206
  • 33
  • 197
  • 283
0

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

Hossein Moradinia
  • 6,116
  • 14
  • 59
  • 85