last inserted id into a textbox-vb.net RRS feed

  • Question

  • User-1578974752 posted

    I have created the sequence with name ID_sn in oracle

    Now this statemnet will insert the next value in to the database.
     cmd.CommandText = "insert into packa(ID) values (ID_sn.NEXTVAL)"


    HOW can i store this value in to a text box?There may be multiple inserts at a time. Appreciate the help.

    Thursday, February 28, 2019 2:09 AM

All replies

  • User409696431 posted

    Check out the second response here: https://community.oracle.com/thread/356998

    It shows setting an output variable and using RETURNING to put the inserted .nextval column value into that variable.  You can then set the Textbox text value to that variable's value.

    Thursday, February 28, 2019 4:35 AM