I'm creating a registration form in MSVStudio and and error always appear. I already set each variable to their own datatype but same error prompt to me. "Conversion from string "The INSERT INTO statement contai" to type 'Boolean' is not valid."
here is my function in my class
Function registercust(ByVal a As String, ByVal b As String, ByVal c As String, ByVal d As String, ByVal f As String, ByVal g As String, ByVal h As DateTime, ByVal i As String, ByVal j As String)
Dim conn As New OleDb.OleDbConnection
Dim dr As OleDb.OleDbDataReader
Dim rs As New OleDb.OleDbCommand
Try
conn.ConnectionString = cs
conn.Open()
query = "Insert into custinfo (`custid`,`lastname`,`firstname`,`mi`,`address`,`telephone`,`birthday`,`age`,`status`) values('" & a & "','" & b & "','" & c & "','" & d & "','" & f & "','" & g & "','" & h & "','" & i & "','" & j & "')"
rs = New OleDb.OleDbCommand(query, conn)
dr = rs.ExecuteReader
If dr.Read Then
Return True
Else
Return False
End If
Catch ex As Exception
Return ex.Message
End Try
conn.Close()
End Function
And Here is my code yo my Button
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
If class1.chkfieldss(TextBox14.Text, TextBox1.Text, _
TextBox8.Text, TextBox9.Text, _
TextBox10.Text, TextBox11.Text, TextBox12.Text) = False Then
If class1.registercust(TextBox14.Text, TextBox1.Text, TextBox8.Text, TextBox9.Text, TextBox10.Text, _
TextBox11.Text, DateTimePicker1.Value, _
TextBox12.Text, ComboBox3.SelectedItem) = False Then
MessageBox.Show("REGISTER SUCCESSFULLY", "Welcome", MessageBoxButtons.OK, MessageBoxIcon.Exclamation)
Else
MessageBox.Show("Something Happen", "Error", MessageBoxButtons.OK, _
MessageBoxIcon.Error)
End If
Else
MessageBox.Show("Complete all fields", "Error", MessageBoxButtons.OK, _
MessageBoxIcon.Error)
End If
End Sub