Hey Guys,
I'm working on a practice Project at the moment where I'm recalling user information from a database, placing it into a form with several textBoxes, comboBoxes, etc and then proceeding to update the information in the database when the user clicks save. I understand this is simple, however snippets I've seen (and I probably haven't searched properly) show how to update one column in the table. I'm using VB.NET 2010 and SQL CE
An example of what I've found is below, which replaces a single entry.
Dim SQLCmd As New SqlCommand("UPDATE tblQuestion SET Answer = 'Like this' Where Question = 'How to use SQL?'")
I guess what I'm needing is to know how to write an SQL Command that updates several columns, on the same row with variables (or even directly from the control) pulled from the form. Can you set multiple columns, and how would I change only the user entry labelled 'John' for example?
For the purposes of this exercise, the table is called 'Users', columns called 'Name', 'Age', 'Address', each user on a different row. Only one user is called into the form, of which I've got the read side of things sorted with a try, while and if to match my inputbox to an entry with sqlDataReader.Item .
It's a silly question I know but I can't for the life of me get in the right headspace to work it out ^_^
Cheers in advance,
Michael