本文介绍了我已经尝试过代码项目同事讨论的更新查询但没有结果的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图更新查询,但是我想要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);

推荐答案


这篇关于我已经尝试过代码项目同事讨论的更新查询但没有结果的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

05-28 09:32
查看更多