I have 3 combo boxes for date,that is day, month and year
i'm confusing with my insert statement
CODE
Private Sub SaveBtn_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles SaveBtn.Click
Dim cn As SqlConnection
Dim cm As SqlCommand
Dim int As Integer 'integer holds the number of records inserted
Dim a As String
Dim b As String
'provide password for sql server
cn = New SqlConnection("server=localhost;uid=sa;pwd=123;database=Enrollment")
cn.Open()
'insert student's details
cm = New SqlCommand("INSERT INTO StudentDetails VALUES ('" & Me.StudentNameTxt.Text & "','" & DayCb.SelectedText & "+ " / " + " & MonthCb.SelectedText & " + " / " +" & YearCb.SelectedText & "' ,'" & Me.BirthcertTxt.Text & "','" & MaleChk.Checked & "+ " / " + " & FemaleChk.Checked & "','" & Me.ContactNumTxt.Text & "','" & Me.CitizenTxt.Text & "','" & Me.CityTxt.Text & "','" & Me.StateTxt.Text & "','" & Me.PostCodeTxt.Text & "','" & Me.AddressRichTxt.Text & "')", cn)
If MaleChk.Checked Then
a = "Male"
ElseIf FemaleChk.Checked Then
b = "Female"
End If
int = cm.ExecuteNonQuery()
'if details save successful
MessageBox.Show("Succeed Save Details!" & int)
cn.Close()
End Sub
it debug successful but when i press save button it appears error as below:
conversion from string "+" to type 'Double' is not valid
Besides that, i put a column for date in my sql database table
Is it correct?