Skip to content

Get Unique ID

Sebastian

Asked May 11, 2006, 5:27 AM EDT1 answer
Share
LinkedInX
Hello,

I am using the following code for inserting a record in a sql server database:

DataRow newCustomersRow = dataSet1.Tables["tMailings"].NewRow();
newCustomersRow["MailingName"] = fieldName.Text.ToString();
newCustomersRow["MailingEmail"] = fieldEmail.Text.ToString();
dataSet1.Tables["tMailings"].Rows.Add(newCustomersRow);

mySqlDataAdapter.RowUpdated += new SqlRowUpdatedEventHandler(handleRowUpdated);
mySqlDataAdapter.Update(dataSet1, "tMailings");
mySqlDataAdapter.RowUpdated -= new SqlRowUpdatedEventHandler(handleRowUpdated);

After the update I want to retrieve the UniqueId "MailingId" from the table tMailings.
I can't get this to work!!!

Can anybody help me??

TNX

1 Answer

Know the answer? Post it. Somebody with the same question will find it here.

  • +1
    you wanna the data after update it, so you can get it from the form, rather than from the database
    +1