【发布时间】:2015-06-08 19:24:48
【问题描述】:
当我在下面的另一台机器上运行时,访问数据库查询失败
Microsoft Word 2013 视觉工作室 2013 Windows 8.1(64 位)
在另一台机器上,相同的查询运行下面的配置
Microsoft Word 2010 视觉工作室 2010 Windows 7(32 位)
下面的查询
con.Open();
string cb = "insert Into Salcmd = new sqles(InvoiceNo,InvoiceDate,CustomerID,SubTotal,VATPercentage,VATAmount,GrandTotal,TotalPayment,PaymentDue,Remarks) VALUES ('" + txtInvoiceNo.Text + "',#" + dtpInvoiceDate.Text + "#,'" + txtCustomerID.Text + "'," + txtSubTotal.Text + "," + txtTaxPer.Text + "," + txtTaxAmt.Text + "," + txtTotal.Text + "," + txtTotalPayment.Text + "," + txtPaymentDue.Text + ",'" + txtRemarks.Text + "')";
cmd = new OleDbCommand(cb);
cmd.Connection = con;
cmd.ExecuteReader();
if (con.State == ConnectionState.Open)
{
con.Close();
}
con.Close();
查询依赖有问题请告诉我
【问题讨论】:
-
你能发布错误信息吗?
-
1) 插入语句中的语法错误 2) 操作必须使用可更新查询。
标签: c# sql visual-studio-2013 sql-insert ms-access-2013