syntax error while inserting data into ms access table

前端 未结 3 761
孤街浪徒
孤街浪徒 2021-01-28 23:31

I have a following code:

OleDbConnection aConnection = new
                    OleDbConnection(\"Provider=Microsoft.ACE.OLEDB.12.0;
                                     


        
3条回答
  •  囚心锁ツ
    2021-01-29 00:13

    Try this:

    string sql = "INSERT INTO Client (cname, phone, [password])
    VALUES('"+textBox1.Text+"','"+textBox2.Text+"','"+textBox3.Text+"')";
    

    You forget parentheses. But better use parameter queries.

提交回复
热议问题