Hello,

 

The SQL Delete command is very easy. These should work

“DELETE * From TableName Where Id = 9. More information on the delete SQL syntax at: http://www.w3schools.com/sql/sql_delete.asp

 

Now as for your

strSQL = "Update ProductInfo Set ProductName = '" & NewName & "', ProductDescription = '" & NewDescription & "',  ProductPrice = '" & NewPrice & "' Where QuantityOnHand = '" & NewQuantity & "'"

You have not asked it to change the NewQuantity field you have used it as a kind of ID. The database engine is looking through each record in the table and if the QuantityOnHand field = the NewQuantity value you are updating the other fields.

 

 


From: [email protected] [mailto:[email protected]] On Behalf Of Jason
Sent: 25 November 2005 03:50
To: [email protected]
Subject: [Microsofts_C_Sharp] update and delete in datagrid

 

here's the update statement i'm using...

strSQL = "Update ProductInfo Set ProductName = '" & NewName & "',
ProductDescription = '" & NewDescription & "',  ProductPrice = '" &
NewPrice & "' Where QuantityOnHand = '" & NewQuantity & "'"

It updates every field except NewQuantity. I also need some assistance
with the delete statement.






SPONSORED LINKS
Basic programming language C programming language Computer programming languages
Programming languages C programming language Software programming language


YAHOO! GROUPS LINKS




Reply via email to