Noob Related record Question RRS feed

  • Question

  • Hi Guru's

    Question for you all.    I am using tableadapters and datasets within VB and all is very well.    id like to be able to add a record to the main table and subsequently a related table.

    I can add the new record to the main table fine, but to maintain PK/FK relationship i need the ID from the newly created record in this main table to add to the related table so that the relationship stays valid.

    As it stands now im not using SQL commands such as @@IDENTITY  is there a way  i can get the identity fed back as a variable from the newly created main table record?

    im sure that youve all encountered this one before.

    Many thanks in advance 

    Mr Noob :)

    Wednesday, July 26, 2006 6:02 AM