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.

Welcome Faiz Azani.
Error message says that your query missing columns of your table. i.e. query has invalid column name.

Read following rule:
1.Homework policy
2.How to post source code?
3.Title of thread must reflect your question.

Source code must be surrounded with code tags.
For example,

[CODE=vb.net] ... statements..

[/code]

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.