Private Sub LoadContent(tbl As String) Dim dt As New DataTable Using conn As New SqlConnection("Initial Catalog=" & cmbDataBases.Text & ";" & "Data Source=localhost;Integrated Security=SSPI;") Dim adpBooks As New SqlDataAdapter("SELECT * FROM " & tbl, conn) adpBooks.Fill(dt) dg.DataSource = dt End Using End Sub Private Sub dg_RowLeave(sender As Object, e As DataGridViewCellEventArgs) Handles dg.RowLeave Application.DoEvents() Dim con As New SqlConnection() con.ConnectionString = connectionString con.Open() Dim [update] As New SqlCommand("SELECT * FROM " & cmbTables.Text, con) Dim da As New SqlDataAdapter([update]) da.SelectCommand = [update] Dim dtab As New DataTable() Dim cb As SqlCommandBuilder = New SqlCommandBuilder(da) da.Update(dtab) con.Close() End Sub
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)