Getting the AutoIncrement column data

Discussion in 'ASP .Net' started by RA, Oct 21, 2003.

  1. RA

    RA Guest

    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
    RA, Oct 21, 2003
    #1
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Munnki
    Replies:
    2
    Views:
    505
    Munnki
    Dec 18, 2003
  2. Gene Gorokhovsky
    Replies:
    0
    Views:
    446
    Gene Gorokhovsky
    Jul 17, 2003
  3. RA
    Replies:
    1
    Views:
    406
    Darrin J Olson
    Oct 22, 2003
  4. fatboycanteen

    About Rowstate and AutoIncrement

    fatboycanteen, Dec 12, 2003, in forum: ASP .Net
    Replies:
    0
    Views:
    301
    fatboycanteen
    Dec 12, 2003
  5. Sky
    Replies:
    2
    Views:
    432
Loading...

Share This Page