| | |
SQL, Dataview, DataTable and DataAdapter.Update
Please support our VB.NET advertiser: Intel Parallel Studio Home
![]() |
when trying to update a sql database i get the following error message on Update
Dynamic SQL generation for the UpdateCommand is not supported against a SelectCommand that does not return any key column information
the column UserID is the PrimaryKey
any ideas would be appreciated
Thanks
Peter
example code:
Dynamic SQL generation for the UpdateCommand is not supported against a SelectCommand that does not return any key column information
the column UserID is the PrimaryKey
any ideas would be appreciated
Thanks
Peter
example code:
VB.NET Syntax (Toggle Plain Text)
Private dt as new datatable private dv as new dataview Public sub GetData dim da as new SqlDataAdapter("SELECT * FROM tblUser", sqlconn.connectionstring) da.fill(dt) dt.TableName = "tblUser dv.table = dt dgUserData.datasource = dv end sub private sub setdata() Dim Row As DataRow Row = dv.Item(dgUserData.CurrentRow.Index).Row Row("username") = txtUsername.text end sub private sub SaveDataToServer() dim da as new SqlDataAdapter("SELECT * FROM tblUser", sqlconn.connectionstring) da.update(dt) end sub
Last edited by ptaylor965; Jun 14th, 2007 at 12:41 pm.
•
•
Join Date: Oct 2008
Posts: 13
Reputation:
Solved Threads: 1
Is your User Name Unique ?
Check that first .
Try this also for update.
http://vb.net-informations.com/dataa...-sqlserver.htm
lemo.
Check that first .
Try this also for update.
http://vb.net-informations.com/dataa...-sqlserver.htm
lemo.
![]() |
Similar Threads
- SQL UPDATE Error (VB.NET)
- read text file (C)
- SQL Query - rarely issue (ASP.NET)
- ASP.Net VB Page to update a users profile not updating. (MS SQL)
- Beginner: Insert, Update, Delete & Search records from/to sql database (ASP.NET)
- AccessDataSource (in 2.0) (ASP.NET)
- Error Message when updating fields (Pascal and Delphi)
- mysql_connect (PHP)
Other Threads in the VB.NET Forum
- Previous Thread: Panel Opacity
- Next Thread: data adapter update method won't work
| Thread Tools | Search this Thread |
"crystal .net .net2005 30minutes 2008 access add application arithmetic array assignment basic binary bing box button buttons click code combo combobox component connectionstring convert cpu data database databasesearch datagrid datagridview design dissertation dissertations dissertationthesis dosconsolevb.net editvb.net employees excel exists file-dialog firewall folder hardcopy image images isnumericfuntioncall login math memory mobile module ms mssqlbackend mysql navigate net networking opacity output peertopeervideostreaming picturebox1 port printpreview problemwithinstallation project record regex reports" reuse right-to-left save savedialog search serial sqldatbase storedprocedure string temp text textbox timer toolbox txttoxmlconverter updown useraccounts usercontrol vb vb.net vb.netcode vb.nettoolboxvisualbasic2008sidebar vbnet view vista visual visualbasic visualbasic.net visualstudio web wpf xml





