AddNew()

  • Thread starter Thread starter Bernhard Wurm
  • Start date Start date
B

Bernhard Wurm

Hello!

How can I get the ID of a new row in my MSDE?
When I programmed ASP classic, I used the AddNew() - Method of the
RecordSet. How can I do this in ADO.NET?

I won't use @@Identity, because it isn't guaranteed, that this is the ID of
my row.

If I use a DataAdapter and a DataSet I've to fill the DataSet with the whole
data of the table?! That's not good!

so how can I do this?

thx
Bernhard Wurm
 
Hi Bernhard,

Bernhard Wurm said:
Hello!

How can I get the ID of a new row in my MSDE?
When I programmed ASP classic, I used the AddNew() - Method of the
RecordSet. How can I do this in ADO.NET?

I won't use @@Identity, because it isn't guaranteed, that this is the ID
of my row.

Instead of @@identity use scope_identity().
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top