Quantcast
Channel: Programming Forums
Viewing all articles
Browse latest Browse all 51036

Update Database Table From DataGrideView on Update Button Click Event

$
0
0
Hello Friends,
I Have a Create Application in VB.Net 08, and i have one DataGrideView, and showing Database Data in That DataGrideView, and i want direct update from SataGridView, using Button Click Event, When I Press Update but it will give this Error : "Update requires a valid UpdateCommand when passed DataRow collection with modified rows."
Note: Im Using SQL Server.
Code:
Private Sub Add_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
              ada.Fill(tab)
        DataGridView1.DataSource = tab.Tables(0)
    End Sub

Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
        ada.Update(tab)
    End Sub



Please Help Me to Solve This Problem...
Thanks In Adv...

Viewing all articles
Browse latest Browse all 51036

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>