| | |
VB 2008 Express Compact SQL UPDATE query error
Please support our VB.NET advertiser: Intel Parallel Studio Home
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: 1965 | Replies: 2
| Thread Tools | Search this Thread |
Tag cloud for VB.NET
"crystal .net .net2005 2008 access add application array assignment basic box button buttons center class click code combo convert cpu data database datagrid datagridview design designer dissertation dissertations dissertationthesis dosconsolevb.net editvb.net employees error excel exists firewall function image images isnumericfuntioncall listview login map math memory mobile module msaccess mssqlbackend mysql navigate net opacity page pan picturebox port print printing printpreview problem record refresh regex reports" reuse right-to-left save savedialog search serial socket sorting sql sqldatbase storedprocedure string structures studio temp textbox timer txttoxmlconverter upload useraccounts usercontol usercontrol vb vb.net vb.nettoolboxvisualbasic2008sidebar vb2008 vbnet vista visual visualbasic visualbasic.net visualstudio2008 web wpf xml





