Forums
New posts
Search forums
What's new
New posts
New profile posts
Latest activity
Members
Current visitors
New profile posts
Search profile posts
C# Community
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Search forums
Menu
Log in
Register
Install the app
Install
Database
ADO.NET
Update requires a valid UpdateCommand when passed DataRow collection
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
[QUOTE="dougancil, post: 135481, member: 29391"] I have a form that when a user fires a buttonclick event that I want to be able to capture any edits/changes that he's made to the dataset that fills a tableadapter. Here is the code I have currently: [code] Public Class ExceptionEdit Private Sub ExceptionEdit_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load 'TODO: This line of code loads data into the 'MDRDataSet.scratchpad3' table. You can move, or remove it, as needed. Me.Scratchpad3TableAdapter.Fill(Me.MDRDataSet.scratchpad3) Exceptioncopy() End Sub Private Sub SaveExceptionButton(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles saveexceptionsButton.Click Try Me.Validate() Me.Scratchpad3BindingSource.EndEdit() Me.Scratchpad3TableAdapter.Update(Me.MDRDataSet.scratchpad3) MsgBox("Update successful") Catch ex As Exception MsgBox("Update failed") End Try Me.Close() ExceptionsFinal.Show() End Sub [/code] and when I debug this, I get an error when I reach this line of code: [code] Me.Scratchpad3TableAdapter.Update(Me.MDRDataSet.scratchpad3) [/code] the error being this: Update requires a valid UpdateCommand when passed DataRow collection with modified rows. The table does have a primary key, and I've seen a lot of people talk about refreshing the data table to make this work, but because am using a temp database, I'd have to programmatically put that in my code somewhere, or is that not the problem at all? Thank you Doug [/QUOTE]
Insert quotes…
Verification
Post reply
Database
ADO.NET
Update requires a valid UpdateCommand when passed DataRow collection
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.
Accept
Learn more…
Top
Bottom