alander
Well-known member
Eh? I dun understand y i get this error..
This is my code for my new button
I do a endedit so that my child table can see the FK
However, this code isnt committed to the database yet, the primary key ISNT a autonumber its a number i assigned to in this case..
and so after user enter all the data for this the user clicks save, after passing all the validation it goes here
Exception occured at
EmployeesInfoTableAdapter.Update(Me.DsEmployee.EmployeesInfo)
PK cannot be a null value.. ??? Ain't it there already?
This is my code for my new button
VB.NET:
Me.EmployeesInfoBindingSource.AddNew()
Me.txtEmpId.Text = maxIdValue + 1
Me.EmployeesInfoBindingSource.EndEdit()
I do a endedit so that my child table can see the FK
However, this code isnt committed to the database yet, the primary key ISNT a autonumber its a number i assigned to in this case..
and so after user enter all the data for this the user clicks save, after passing all the validation it goes here
VB.NET:
Me.Validate()
EmployeesInfoBindingSource.EndEdit()
EmployeesInfoTableAdapter.Update(Me.DsEmployee.EmployeesInfo)
Exception occured at
EmployeesInfoTableAdapter.Update(Me.DsEmployee.EmployeesInfo)
PK cannot be a null value.. ??? Ain't it there already?
Last edited: