none
Calling oracle sequence.nextval to display in a form RRS feed

  • Question

  •  

    Hi I have a form that currently has it's primary key ID field populated by vb's autoincrement. But this application I am developing will be for use in a multi-user environment, so I have create an oracle sequence to populate the values for me. Now I need to display this value ideally in a textbox... then the user will fill in his details and submit them to the database for inserting. The reason I need to display the value is that ID values are written down for reference later. So what I am asking is, is there a way of calling .nextval to display in a textbox in a vb.net form. So on creating a new record the textbox gets populated

     

    I am using vb.net 2005

     

     

    Regards

    Tuesday, February 26, 2008 4:10 PM

Answers

  • You can call ExecuteScalar with a command similar to the following:

     

    SELECT MySequence.NEXTVAL FROM DUAL

     

     

     

    Tuesday, February 26, 2008 6:48 PM

All replies

  • You can call ExecuteScalar with a command similar to the following:

     

    SELECT MySequence.NEXTVAL FROM DUAL

     

     

     

    Tuesday, February 26, 2008 6:48 PM
  • Thanks for yor swift reply I have now looked at using executeScalar and it seems this is exactly what I need.

     

    Many Thanks

    Sunday, March 2, 2008 1:27 PM