Hi I would like to know if anybody could help me insert records into a MS access database
with VB.net, I'm actually a c# programmer and I have never worked with databases before, I got as far as connecting but as soon as I want to add a record I get a "No value given for one or more required parameters" error. Here is the Code.
Private Sub btnCreate_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnCreate.Click
Dim tiepe As String = ""
If radAgent.Checked = True Then
tiepe = "Agent"
End If
If radManager.Checked = True Then
tiepe = "Manager"
End If
If radMandate.Checked = True Then
tiepe = "Mandate Holder"
End If
If radTeller.Checked = True Then
tiepe = "Teller"
End If
Try
dbInsert.CommandText = "INSERT INTO Access (NameSurname, ABNumber, SleutelWoord, Tiepe) VALUES (txtName.Text, txtUser.Text, txtPassword.Text, tiepe);"
dbInsert.CommandType = CommandType.Text
dbInsert.Connection = dbConnect
dbInsert.ExecuteNonQuery()
MessageBox.Show("Access created Succesfully for " + Line + txtName.Text)
Catch ex As Exception
MessageBox.Show(ex.Message)
End Try
End Sub