Home > Net >  System. Data. The OleDb. OleDbException: the INSERT INTO statement syntax error exception
System. Data. The OleDb. OleDbException: the INSERT INTO statement syntax error exception

Time:11-28

In the System. Data. The OleDb. OleDbException: INSERT INTO statement syntax error abnormal problems

Made a user registration page, and then after input the necessary information, click on [registered] appear afore-mentioned problems,

Code:
Private void RegisterSubmit_Click (object sender, EventArgs e)
{
OleDbConnection oleDb=new OleDbConnection (@ ". The Provider=Microsoft Jet. The oleDb. 4.0; The Data Source=C: \ Users \ \ * * * * * * * * * \ Questionnaire MDB ");
The oleDb. The Open ();

String t1=textBox1. Text;
String t2=textBox2. Text;
The string t3=textBox3. Text;
Int t4=int. Parse (textBox4. Text);

String SQL="insert into User ([username], ["], [full_name], [age]) values ('" + t1 + "', '" + t2 +"', '" + t3 + "', '" + t4 + ") ";

OleDbCommand aCommand=new OleDbCommand (SQL, oleDb);
ACommand. ExecuteNonQuery ();
The oleDb. Close ();

MessageBox. Show (" Register successful!" );

This. Hide ();
UserLogin UserLogin=new UserLogin ();
Userlogin. ShowDialog ();
}

I don't know what went wrong,
  •  Tags:  
  • C#
  • Related