问题描述
我试图更新查询,但是我想要Innerjoin语句不成功
cmd = new OleDbCommand(UPDATE InvoiceItems set Description ='+ txtProductName +',Quantity ='+ txtQty.Text +',UOM ='+ txtUOM.Text +',UnitPrice ='+ txtUnitPrice.Text +',GrossAmount ='+ txtGrossAmount.Text +',VAT ='+ txtVAT。 Text +',VatAmount ='+ txtVatAmount.Text +',Total ='+ txtTotal.Text +',来自InvoiceItems,Products INNERJOIN InvoiceItems.ProductId = Products.ProductId where InvoiceNumber ='+ txtInvoice.Text .Trim()+',conn);
我尝试过:
cmd = new OleDbCommand(UPDATE InvoiceItems set Description ='+ txtProductName +',Quantity ='+ txtQty.Text +',UOM ='+ txtUOM.Text +',UnitPrice ='+ txtUnitPrice.Text +',GrossAmount ='+ txtGrossAmount.Text +',VAT ='+ txtVAT.Text +',VatAmount ='+ txtVatAmount.Text + ,Total ='+ txtTotal.Text +',来自InvoiceItems,Products INNERJOIN InvoiceItems.ProductId = Products.ProductId其中InvoiceNumber ='+ txtInvoice.Text.Trim()+',conn);
I have tried to update the query but it was unsuccessful I want Innerjoin statements
cmd = new OleDbCommand("UPDATE InvoiceItems set Description ='" + txtProductName + "',Quantity = '" + txtQty.Text + "',UOM = '" + txtUOM.Text + "',UnitPrice ='" + txtUnitPrice.Text + "',GrossAmount ='" + txtGrossAmount.Text + "',VAT = '" + txtVAT.Text + "',VatAmount ='" + txtVatAmount.Text + "',Total ='" + txtTotal.Text + "', from InvoiceItems,Products INNERJOIN InvoiceItems.ProductId = Products.ProductId where InvoiceNumber='" + txtInvoice.Text.Trim() + "'", conn);
What I have tried:
cmd = new OleDbCommand("UPDATE InvoiceItems set Description ='" + txtProductName + "',Quantity = '" + txtQty.Text + "',UOM = '" + txtUOM.Text + "',UnitPrice ='" + txtUnitPrice.Text + "',GrossAmount ='" + txtGrossAmount.Text + "',VAT = '" + txtVAT.Text + "',VatAmount ='" + txtVatAmount.Text + "',Total ='" + txtTotal.Text + "', from InvoiceItems,Products INNERJOIN InvoiceItems.ProductId = Products.ProductId where InvoiceNumber='" + txtInvoice.Text.Trim() + "'", conn);
推荐答案
这篇关于我已经尝试过代码项目同事讨论的更新查询但没有结果的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!