I do not have a lot of experience in vb.net, but I am trying to use OleDB to insert a record with String,string,Yes/no(studentname, number, gender). However when I insert it , there's a exception raised stating that I have invalid syntax for the "insert into" query. I could not spot the error.
Test case:
txtName.Text = "asdasdasd"
txtPhone.Text = "123456789"
rGender.Checked = True
Here's the code:
cmd = New OleDbCommand()
With cmd
.Connection = cn
.CommandText = "INSERT INTO [Student] (StudentName, Number, Gender) VALUES(@Name,@Number,@Gender)"
.CommandType = CommandType.Text
.Parameters.AddWithValue("@Name", txtName.Text)
.Parameters.AddWithValue("@Number", txtPhone.Text)
.Parameters.AddWithValue("@Gender", rGender.Checked)
End With