C
Christopher Lusardi
How can I fix this? When I do the below I get the error message:
"Cannot insert explict value for identity column in table
'Employees' when IDENTITY_INSERT is set to OFF."
To get this message, I click the Add button to add a new row to the
database, and then I click the Update button to save the new database
to the external memory.
The methods I used are below.
Thanks,
Chris Lusardi
Private Sub btnAdd_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles btnAdd.Click
Dim drNew As DataRow
drNew = dsAdoSbs.Employees.NewRow()
drNew.Item("FirstName") = "New First"
drNew.Item("LastName") = "New Last"
dsAdoSbs.Employees.Rows.Add(drNew)
End Sub
Private Sub btnUpdate_Click(ByVal sender As System.Object, ByVal e
As System.EventArgs) Handles btnUpdate.Click
daEmployees.Update(dsAdoSbs.Employees)
UpdateDisplay()
End Sub
"Cannot insert explict value for identity column in table
'Employees' when IDENTITY_INSERT is set to OFF."
To get this message, I click the Add button to add a new row to the
database, and then I click the Update button to save the new database
to the external memory.
The methods I used are below.
Thanks,
Chris Lusardi
Private Sub btnAdd_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles btnAdd.Click
Dim drNew As DataRow
drNew = dsAdoSbs.Employees.NewRow()
drNew.Item("FirstName") = "New First"
drNew.Item("LastName") = "New Last"
dsAdoSbs.Employees.Rows.Add(drNew)
End Sub
Private Sub btnUpdate_Click(ByVal sender As System.Object, ByVal e
As System.EventArgs) Handles btnUpdate.Click
daEmployees.Update(dsAdoSbs.Employees)
UpdateDisplay()
End Sub