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

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:
    652
    Munnki
    Dec 18, 2003
  2. RA
    Replies:
    1
    Views:
    555
    Darrin J Olson
    Oct 22, 2003
  3. fatboycanteen

    About Rowstate and AutoIncrement

    fatboycanteen, Dec 12, 2003, in forum: ASP .Net
    Replies:
    0
    Views:
    445
    fatboycanteen
    Dec 12, 2003
  4. Sky
    Replies:
    2
    Views:
    653
  5. carlos perez
    Replies:
    0
    Views:
    571
    carlos perez
    Jun 8, 2004
  6. =?Utf-8?B?TmVpbA==?=

    Autoincrement / Rowstate problems

    =?Utf-8?B?TmVpbA==?=, Oct 15, 2004, in forum: ASP .Net
    Replies:
    0
    Views:
    497
    =?Utf-8?B?TmVpbA==?=
    Oct 15, 2004
  7. yui
    Replies:
    17
    Views:
    4,307
    deric
    Jul 14, 2009
  8. Enum autoincrement question

    , Oct 14, 2010, in forum: C Programming
    Replies:
    5
    Views:
    1,640
Loading...