string ConStr = "provider=Microsoft.jet.oledb.4.0;data source =" + Application.StartupPath + @"\Database.mdb";
            OleDbConnection Olecon = new OleDbConnection(ConStr);
            Olecon.Open();
            string strInsert = "INSERT TNTO 学生信息(学号, 姓名 ,性别 ,班级 ,成绩) VALUES (" + textBox1.Text + ", '" + textBox2.Text+ "', '" + textBox3.Text+ "', '" + textBox4.Text + "'," + textBox5.Text+ ")";
            OleDbCommand inst = new OleDbCommand(strInsert,Olecon);
            inst.ExecuteNonQuery();
            Olecon.Close();
            Olecon.Dispose();
报错:SQL语句错误

解决方案 »

  1.   

    "INSERT TNTO 学生信息(学号, 姓名 ,性别 ,班级 ,成绩) VALUES ('" + textBox1.Text + "', '" + textBox2.Text + "', '" + textBox3.Text+ "', '" + textBox4.Text + "','" + textBox5.Text+ "')"; 
      

  2.   

    "INSERT TNTO 学生信息(学号, 姓名 ,性别 ,班级 ,成绩) VALUES (" + textBox1.Text + ", '" + textBox2.Text+ "', '" + textBox3.Text+ "', '" + textBox4.Text + "'," + textBox5.Text+ ")"; 
      

  3.   

    "INSERT TNTO 学生信息(学号, 姓名 ,性别 ,班级 ,成绩) VALUES (" + textBox1.Text + ", '" + textBox2.Text+ "', '" + textBox3.Text+ "', '" + textBox4.Text + "'," + textBox5.Text+ ")";
      

  4.   


     
    sharkss
     
    (sharkss) 等 级: 
    结帖率:0.00% 
      

  5.   

    ...   "INSERT TNTO 学生信息(
     insert into   不是  insert tnto      
    无语了..