Hai i got a probleam with my sql command for update. Please advice me how i able to correct my command The error which i got got is Incorrect syntax near Total.Here is may code. I also highlight the line which cause me and error
Try
Connect = New OleDbConnection("Provider=SQLOLEDB ;Data Source=Danawa;Initial Catalog=Store;Integrated Security=SSPI ")
Connect.Open()
cmd = New OleDbCommand ("UPDATE ItemIn SET Itemquantity= Itemquantity - '" & ItemquantityTextBox.Text & "AND" & "'Total= Total -'" & total.Text & "'WHERE ItemName= '" & ItemNameComboBox.Text & "' ", Connect) / i got an error in this line
ra = cmd.ExecuteNonQuery()
Catch ex As Exception
MsgBox(ex.Message)
End Try
MsgBox(" Purchase Successfull ", MsgBoxStyle.Information)
Connect.Close()
Probleam: probleam with sql command
Page 1 of 11 Replies - 210 Views - Last Post: 12 October 2011 - 10:00 PM
Replies To: Probleam: probleam with sql command
#2
Re: Probleam: probleam with sql command
Posted 12 October 2011 - 10:00 PM
Do you know how this part will be rad in database?'" & ItemquantityTextBox.Text & "AND" & "'Total= Total -'" & total.Text & "'? It will be like
Things to notice:
- You put AND in single quote with item quality together as one thing.
- You put value from text box in single quote then try to minus it with something unknown in database
'Good AND' Total= Total - '8'
Things to notice:
- You put AND in single quote with item quality together as one thing.
- You put value from text box in single quote then try to minus it with something unknown in database
Page 1 of 1
|
|

New Topic/Question
Reply



MultiQuote




|