Greetings all, I am a beginner for VB.net. Thus, I have a problem regarding the code below;
Private Sub btnSaveUpdates_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnSaveUpdates.Click
Dim changes As Integer
Dim strYear As String
Dim dataAdapter As New OleDb.OleDbDataAdapter(sqlStr, connStr)
Dim commandBuilder As New OleDb.OleDbCommandBuilder(dataAdapter)
strYear = cboYear.Text
changes = dataAdapter.Update(dt) <-----error here
dataAdapter.Dispose()
If cboYear.Text = "2004" Then
MsgBox("No record stored.", MsgBoxStyle.Critical)
dgvDisplayDemand.DataSource = ""
ElseIf cboYear.Text = "2009" Then
If changes > 0 Then
MessageBox.Show("Saved")
Else
MessageBox.Show("No changed")
End If
End If
End Sub
As the results, it was an error .
OleDbException was unhandled, "No value given for one or more required parameters".
Anyone,kindly please help me. I am stuck.Thanks in advance.