c#向access中插入记录,inst.ExecuteNonQuery();语句出现了错误:至少一个参数没有被指定值。求大神赐教~
privatevoidbutton1_Click(objectsender,EventArgse){StringstrConn="Provider=Microsoft.J...
private void button1_Click(object sender, EventArgs e)
{
String strConn = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=Database5.mdb;";
OleDbConnection myconn = new OleDbConnection(strConn);
myconn.Open();
String strinsert = "INSERT INTO 表名(字段名) VALUES (textBox1.Text)";
OleDbCommand inst=new OleDbCommand(strinsert,myconn);
inst.ExecuteNonQuery();
myconn.Close();
} 展开
{
String strConn = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=Database5.mdb;";
OleDbConnection myconn = new OleDbConnection(strConn);
myconn.Open();
String strinsert = "INSERT INTO 表名(字段名) VALUES (textBox1.Text)";
OleDbCommand inst=new OleDbCommand(strinsert,myconn);
inst.ExecuteNonQuery();
myconn.Close();
} 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询