It appears you have not yet registered with DEVPPL. To register please click here... (it's fast, easy and free!)

Forum

Log In Sponsors
Board index Programming Visual Basic Forum

Unable to edit and delete rows in my database from vb 2005

Moderator: dafunkymunky

Unable to edit and delete rows in my database from vb 2005

Postby yemsot on Wed May 09, 2007 9:34 am

i have been unable to edit a row in my database and also delete in the database at runtime. though i can add. but when i edit a record and click the save button it's throwing this exception:

'Update requires a valid UpdateCommand when passed DataRow collection with modified rows.'

also if i delete a particular row from my table and click the save button, it throws the exception:
'Update requires a valid DeleteCommand when passed DataRow collection with deleted rows.'


I'm using vb 2005, with mssql server 2005
this is the code for the save button:

Code: Select all
Private Sub Student_details_tableBindingNavigatorSaveItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Student_details_tableBindingNavigatorSaveItem.Click

Me.Validate()

Me.Student_details_tableBindingSource.EndEdit()

Me.Student_details_tableTableAdapter.Update _
(Me.School_management1DataS et.student_details_table)
Me.School_management1DataSet.student_details_table.AcceptChanges()

End Sub


Please tell me the correct code to write so that the dataset will be able to update when i alter a row or delete some rows. :?:
yemsot
 
Posts: 2
Joined: Wed May 09, 2007 8:50 am
Location: Nigeria

Who is online

Users browsing this forum: No registered users and 2 guests