我的SQL statments如下 插入語句只 update和delete語句不工作DataAdapter.Update()不起作用更新
Purchase_InvoiceNo是採購表 的主鍵列我得到這個值這樣並插入其值設置爲PurchaseProduct表 「SELECT IDENT_CURRENT( '購買')AS [Purchase_InvoiceNo]」
string deletecmd_PurchaseProduct =
@"DELETE FROM PurchaseProduct " +
"[email protected]_No and "+
"[email protected]_InvoiceNo ";
string updatcmd_PurchaseProduct =
"UPDATE PurchaseProduct "
+ " SET "
+ " PurchaseProduct_SerialNo [email protected]_SerialNo"
+ ", Purchase_InvoiceNo [email protected]_InvoiceNo"
+ ", ProductNo [email protected]"
+ " PurchaseProduct_Quantity [email protected]_Quantity "
+ ", PurchaseProduct_Unit [email protected]_Unit"
+ ", PurchaseProduct_Price [email protected]_Price"
+ " Where "
+ " [email protected]_No";
string insertcmd_PurchaseProduct = "INSERT INTO PurchaseProduct" +
"(" +
" PurchaseProduct_SerialNo"+
",Purchase_InvoiceNo" +
",ProductNo" +
",PurchaseProduct_Quantity " +
",PurchaseProduct_Price" +
",PurchaseProduct_Unit" + //6
")" +
"Values" +
"(" +
" @PurchaseProduct_SerialNo"+
",@Purchase_InvoiceNo" +
",@ProductNo " +
",@PurchaseProduct_Quantity " +
",@PurchaseProduct_Price" +
",@PurchaseProduct_Unit" + //6
");";
你有什麼錯誤嗎?如果是這樣,他們是什麼? –