This is a migrated thread and some comments may be shown as answers.

Unable to update when row changed

1 Answer 159 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Raymond Le
Top achievements
Rank 1
Raymond Le asked on 05 Apr 2010, 01:12 AM
I am using the beta version of the RadWinsForms,  trying to follow the GridView tutorial but could not make this work.

    Private Sub GridView_RowsChanged(ByVal sender As System.ObjectByVal e As Telerik.WinControls.UI.GridViewCollectionChangedEventArgs) Handles GridView.RowsChanged 
        Dim objconnection1 As New SqlClient.SqlConnection("Data Source=(local);Initial Catalog=OTMC_HR; Integrated Security=True"
        Dim objDataAdapter1 As New SqlClient.SqlDataAdapter("Use OTMC_HR SELECT E.EmployeeID, FirstName, lastname, " & _ 
                                                            "E.WorkingPhone, HomePhone, E.Email,  P.PositionTitle,D.DepartmentName " & _ 
                                                            "FROM Employee AS E INNER JOIN Department AS D  ON E.DepartmentID = D.DepartmentID " & _ 
                                                            "INNER JOIN Position AS P ON E.PositionID = P.PositionID ", objconnection1) 
        Dim objDataSet1 As DataSet 
        objDataSet1 = New DataSet() 
        objDataAdapter1.Fill(objDataSet1, "EmployeeContactList"
        If (e.Action = Telerik.WinControls.Data.NotifyCollectionChangedAction.ItemChanged) Then 
            objDataAdapter1.Update(objDataSet1) 
        End If 
    End Sub 

When the data is edited, I" got Update unable to find TableMapping['Table'] or DataTable 'Table'."

Any suggestion to fix this problem

1 Answer, 1 is accepted

Sort by
0
Martin Vasilev
Telerik team
answered on 07 Apr 2010, 03:08 PM
Hi Raymond Le,

Thank you for contacting us.

I am not sure I understand exactly your goal, but if you want to save the changes to your database, you have to apply the TableAdapter.Update method to your current grid's datasource, not to create a new one. Please, find more details how to save changes to the database in the MSDN library.

Let me know if you have any additional questions related to our tools.

Sincerely yours,
Martin Vasilev
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
Tags
GridView
Asked by
Raymond Le
Top achievements
Rank 1
Answers by
Martin Vasilev
Telerik team
Share this question
or