J
Jasima DJ
I wrote the following code for my submit button...
Private Sub tb_submit_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles tb_submit.Click
Dim strSQL As String = _
"INSERT INTO Members
(userId,password,verify,email,country,addess) VALUES('" + tb_userId.Text
+ "', '" + tb_password.Text + "', '" + tb_verify.Text + "', '" +
tb_email.Text + "', '" + tb_country.Text + "', '" + tb_address.Text +
"')"
OleDbConnection1.Open()
Dim cmd As New OleDbCommand(strSQL, OleDbConnection1)
cmd.ExecuteNonQuery()
OleDbConnection1.Close()
End Sub
===========================================================
But i keep getting the following error.....I cant seem to fix...can you
elp me fix it? plzzz....
Syntax error in INSERT INTO statement.
Description: An unhandled exception occurred during the execution of the
current web request. Please review the stack trace for more information
about the error and where it originated in the code.
Exception Details: System.Data.OleDb.OleDbException: Syntax error in
INSERT INTO statement.
Source Error:
Line 53: OleDbConnection1.Open()
Line 54: Dim cmd As New OleDbCommand(strSQL, OleDbConnection1)
Line 55: cmd.ExecuteNonQuery()
Line 56: OleDbConnection1.Close()
Line 57: End Sub
Private Sub tb_submit_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles tb_submit.Click
Dim strSQL As String = _
"INSERT INTO Members
(userId,password,verify,email,country,addess) VALUES('" + tb_userId.Text
+ "', '" + tb_password.Text + "', '" + tb_verify.Text + "', '" +
tb_email.Text + "', '" + tb_country.Text + "', '" + tb_address.Text +
"')"
OleDbConnection1.Open()
Dim cmd As New OleDbCommand(strSQL, OleDbConnection1)
cmd.ExecuteNonQuery()
OleDbConnection1.Close()
End Sub
===========================================================
But i keep getting the following error.....I cant seem to fix...can you
elp me fix it? plzzz....
Syntax error in INSERT INTO statement.
Description: An unhandled exception occurred during the execution of the
current web request. Please review the stack trace for more information
about the error and where it originated in the code.
Exception Details: System.Data.OleDb.OleDbException: Syntax error in
INSERT INTO statement.
Source Error:
Line 53: OleDbConnection1.Open()
Line 54: Dim cmd As New OleDbCommand(strSQL, OleDbConnection1)
Line 55: cmd.ExecuteNonQuery()
Line 56: OleDbConnection1.Close()
Line 57: End Sub