Cannot add new record
Hi, i am doing a database project that store some information abt the different types of telescopes that are sold in a shop. However, i encounter a problem. Whenever i added and saved a new record, i was prompted with this error msg "An unhandled exception of type 'System.Data.NoNullAllowedException' occured in system.data.dll Additional information:Column 'ItemID' does not allow nulls.
I stored my data in Microsoft Acsess, so i thought that i might have missed something there. But after checking, i found no problem with the database at all including the 'ItemID' portion which is set as the primary key. All fields have been filled up.
Below is the code that i have used
Private Sub btnLoad_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnLoad.Click
Dim dsTemp As New DataSet1
Catch ex As Exception
MsgBox("Error to fill data set")
Private Sub btnAdd_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnAdd.Click
Private Sub btnSave_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnSave.Click
Dim dsTemp As DataSet1
Me.BindingContext(DataSet11, "telescope").EndCurrentEdit() *<-This is the part where the program got stuck and highlighted in green color.
If DataSet11.HasChanges Then
dsTemp = CType(DataSet11.GetChanges, DataSet1)
The error msg always appears after i clicked the save button. Is this a coding problem or something is wrong with my Access database?