I have setup a simple table in SQL 2005 with 2 fields, EmployeeID and EmployeeName. EmployeeID is an identity field.
A created a new form and setup a data source added the 2 fields to the form by clicking and dragging from the data source. Visual studio setup the TableAdapter, DataSet and BindingSource.
I am able to create and save records from the form to the database.
When I click the new button, the EmployeeID column shows a negative number. When I save the record, the EmployeeID is changed. I understand why negative numbers are used and that I can change them to positive but I do not want any number to appear in the EmployeeID column until the record is saved. So I turned off the Identity setting in the dataset and it leaves the EmployeeID box blank. However, when I save, I get an Error that EmployeeID cannot be blank.
If I remove the EmployeeID box from the form, I can successfully save but obviously, I cannot show the ID number. Can someone please help me solve this? I need for the record to be saved with the contents of the EmployeeID being left blank on the form. Hope that makes sense.
Thanks
A created a new form and setup a data source added the 2 fields to the form by clicking and dragging from the data source. Visual studio setup the TableAdapter, DataSet and BindingSource.
I am able to create and save records from the form to the database.
When I click the new button, the EmployeeID column shows a negative number. When I save the record, the EmployeeID is changed. I understand why negative numbers are used and that I can change them to positive but I do not want any number to appear in the EmployeeID column until the record is saved. So I turned off the Identity setting in the dataset and it leaves the EmployeeID box blank. However, when I save, I get an Error that EmployeeID cannot be blank.
If I remove the EmployeeID box from the form, I can successfully save but obviously, I cannot show the ID number. Can someone please help me solve this? I need for the record to be saved with the contents of the EmployeeID being left blank on the form. Hope that makes sense.
Thanks