Inserting a Value into an SQL Identity Field in VB
I am using Visual Basic .Net to insert values into an SQL Database.
One of the fields I have is an Identity Field, the purpose of this field in my database is to have a number that increments by 1 each time a record is entered.
The problem is that I don't know what value to use in my INSERT INTO command to do this. Because I am new to this, my understanding of the Identity field was that it automatically incremented the value in that field each time a new record was inserted, if this is not the case can someone help me with this.
Basically I have a field called ReportID, I am inserting a date and a name into this database and I want it to auto-generate the ReportID number to increment by 1 each time a record is entered. Bearing in mind the each value is stored in a string or date variable.
I am pulling my hair out, so any help would be great!
VBMazza
|