|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Update command to update fieldIn sql server I can run the following query command to update QtyOnPO field.
UPDATE ItemsDetails SET QtyOnPO = QtyOnPO + 1 WHERE (ItemDetailID = 1) This will add 1 to QtyOnPO field. In VB.NET how can I use this? The following is my code but it gives an error "Name 'QtyOnPO' is not declared". ExecNonQuery("UPDATE Pricing SET QtyOnPO = " & QtyOnPO + row.Cells(Me.Qty.Index).Value & " WHERE ItemDetailID = " & intItemDetailID) Please help Jay wrote:
Show quoteHide quote > In sql server I can run the following query command to update QtyOnPO Dim sql As String> field. > > UPDATE ItemsDetails > SET QtyOnPO = QtyOnPO + 1 > WHERE (ItemDetailID = 1) > > This will add 1 to QtyOnPO field. > > In VB.NET how can I use this? > > The following is my code but it gives an error "Name 'QtyOnPO' is not > declared". > > ExecNonQuery("UPDATE Pricing SET QtyOnPO = " & QtyOnPO + > row.Cells(Me.Qty.Index).Value & " WHERE ItemDetailID = " & intItemDetailID) > > Please help sql = "UPDATE Pricing SET" sql &= " QtyOnPO = QtyOnPO + " & row.Cells(Me.Qty.Index).Value sql &= " WHERE ItemDetailID = " & intItemDetailID Debug.WriteLine(sql) 'check what you're going to execute Etc. Thank you
Show quoteHide quote "Jason Keats" <jke***@melbpcDeleteThis.org.au> wrote in message news:#DNTJi24KHA.420@TK2MSFTNGP02.phx.gbl... > Jay wrote: >> In sql server I can run the following query command to update QtyOnPO >> field. >> >> UPDATE ItemsDetails >> SET QtyOnPO = QtyOnPO + 1 >> WHERE (ItemDetailID = 1) >> >> This will add 1 to QtyOnPO field. >> >> In VB.NET how can I use this? >> >> The following is my code but it gives an error "Name 'QtyOnPO' is not >> declared". >> >> ExecNonQuery("UPDATE Pricing SET QtyOnPO = " & QtyOnPO + >> row.Cells(Me.Qty.Index).Value & " WHERE ItemDetailID = " & >> intItemDetailID) >> >> Please help > > Dim sql As String > > sql = "UPDATE Pricing SET" > sql &= " QtyOnPO = QtyOnPO + " & row.Cells(Me.Qty.Index).Value > sql &= " WHERE ItemDetailID = " & intItemDetailID > > Debug.WriteLine(sql) 'check what you're going to execute > > Etc. > > So QtyOnPo which has to be a (numeric) field, property or method(returning a
number), is not declared (available) in the method where you use it. (Most probably it is a not created global field, while you had the intention to do that) Show quoteHide quote "Jay" <jpab***@gmail.com> wrote in message news:epTXzW14KHA.3824@TK2MSFTNGP04.phx.gbl... > In sql server I can run the following query command to update QtyOnPO > field. > > UPDATE ItemsDetails > SET QtyOnPO = QtyOnPO + 1 > WHERE (ItemDetailID = 1) > > This will add 1 to QtyOnPO field. > > In VB.NET how can I use this? > > The following is my code but it gives an error "Name 'QtyOnPO' is not > declared". > > ExecNonQuery("UPDATE Pricing SET QtyOnPO = " & QtyOnPO + > row.Cells(Me.Qty.Index).Value & " WHERE ItemDetailID = " & > intItemDetailID) > > Please help >
signing certificate error...
Sending messages between windows Setting Event Log Size setting Posting a form to webserver using vb.net ASP table background color FTP Server Passive Mode Running an ActiveX EXE from VB2008 app Run Unix shell script from VB.NET Is that a blank in your TextBox ... How to build the form with details button? |
|||||||||||||||||||||||