Getting the AutoIncrement column data

R

RA

Hi

I have the following datarow that I want to add to a datatable.
DataRow newRow = ds.Tables["Customers"].NewRow ();

newRow["ContactFirstName"] = Cache["FirstName"].ToString ();

newRow["ContactLastName"] = Cache["LastName"].ToString ();

ds.Tables["Customers"].Rows.Add (newRow);



After the row has been added I want to get the row column value of
CustomerId (This column is defined in the database as Autoincrement).

How can I get this value? I need this value in order to update the orders
table which has a CustomeId column.



Thanks,

Ron
 

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

Members online

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top