| | |
VB 2008 Express Compact SQL UPDATE query error
Please support our VB.NET advertiser: Programming Forums - DaniWeb Sister Site
Thread Solved |
•
•
Join Date: Jul 2008
Posts: 42
Reputation:
Solved Threads: 1
Hi,
Using VB 2008 Express with Compact SQL .sdf database.
I have a form that at form load fills the form with a single record as selected by double clicking row header on a datagrid. This works fine. But when I change a field and hit the save data button error I get an error that there must be a valid update statement.
So I figured, I'll just put a button on the form and on button click run a query statement like
UPDATE Names SET name = @p1, Address = @p2
This works, but it updates every record in the file, so I changed it to
UPDATE Names SET name = @p1, Address = @p2
WHERE Name = @p3, Address = @p4
But It won't compile. I get a build error.
How do I update a single record using the query builder in the table adapter. I have tried a number of things and am getting nowhere.
Thanks,
Bill Purkins
Using VB 2008 Express with Compact SQL .sdf database.
I have a form that at form load fills the form with a single record as selected by double clicking row header on a datagrid. This works fine. But when I change a field and hit the save data button error I get an error that there must be a valid update statement.
So I figured, I'll just put a button on the form and on button click run a query statement like
UPDATE Names SET name = @p1, Address = @p2
This works, but it updates every record in the file, so I changed it to
UPDATE Names SET name = @p1, Address = @p2
WHERE Name = @p3, Address = @p4
But It won't compile. I get a build error.
How do I update a single record using the query builder in the table adapter. I have tried a number of things and am getting nowhere.
Thanks,
Bill Purkins
You seem to have a syntax error in the SQL clause, it should be
SQL Syntax (Toggle Plain Text)
UPDATE Names SET name = @p1, Address = @p2 WHERE Name = @p3 AND Address = @p4
Teme64 @ Windows Developer Blog
![]() |
Similar Threads
- Help with automatic update problem and more (Viruses, Spyware and other Nasties)
Other Threads in the VB.NET Forum
- Previous Thread: Music Sequencer written in Visual Basic
- Next Thread: how to import data from sql to ms access in vb.net through coding
Views: 1969 | Replies: 2
| Thread Tools | Search this Thread |
Tag cloud for VB.NET
.net 2005 2008 access account application arithmetic array arrays basic bing button buttons c# center check checkbox code combobox component convert crystalreport data database databasesearch datagrid datagridview design designer dissertation dissertations dropdownlist excel file-dialog folder ftp generatetags google gridview hardcopy highlighting images inline insert installer intel internet listview mobile monitor ms net networking output passingparameters peertopeervideostreaming picturebox picturebox1 plugin port print printing problem problemwithinstallation project save searchbox searchvb.net select serial server soap sorting studio syntax table tcp text textbox time timer toolbox trim update updown user vb vb.net vb.netcode vb.netformclosing()eventpictureboxmessagebox vb2008 vbnet view visual visualbasic visualbasic.net visualstudio visualstudio2008 web wpf





