I have vb.net application with MDF-Sql database.
I retrieves data from Table in MDF-Sql into datagridview by TableAdaptermanager/binding navifator. Although it displays data but when I want to save by this code, its not working.This code is working in vb.net with OleDb application but not here. Is there any another way to save/update data in datagridview.
My code is-

Public Class Form1

    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        'TODO: This line of code loads data into the 'SatyamDataSet1.Accessonbook' table. You can move, or remove it, as needed.
        Me.AccessonbookTableAdapter.Fill(Me.SatyamDataSet1.Accessonbook)

    End Sub

    Private Sub AccessonbookBindingNavigatorSaveItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles AccessonbookBindingNavigatorSaveItem.Click
        Me.Validate()
        Me.AccessonbookBindingSource.EndEdit()
        Me.TableAdapterManager.UpdateAll(Me.SatyamDataSet1)

    End Sub
End Class

Do this test when you save.

msgbox(AccessonbookTableAdapter.Adapter.UpdateCommand.CommandText)

Is it empty?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.