download gratis video tutorial vb 6 dan vb.net plus contoh aplikasi

cara menampilkan data dari datagridview ke dalam textbox

 

 

 

Imports System.Data.SqlClient

 

Public Class sqlserver2005

Dim conn As SqlConnection
Dim da As SqlDataAdapter
Dim ds As DataSet

 

Sub koneksi()
conn = New SqlConnection("data source=user-pc\sqlexpress;initial catalog=mydbagain;integrated security=true")
conn.Open()

End Sub

 

Private Sub DGV_CellMouseClick (ByVal sender As Object, ByVal e As System. Windows. Forms. DataGridViewCellMouseEventArgs) Handles DGV.CellMouseClick
On Error Resume Next
TextBox3.Text = DGV.Rows(e.RowIndex).Cells(0).Value
TextBox4.Text = DGV.Rows(e.RowIndex).Cells(1).Value
TextBox5.Text = DGV.Rows(e.RowIndex).Cells(2).Value
TextBox6.Text = DGV.Rows(e.RowIndex).Cells(3).Value
TextBox7.Text = DGV.Rows(e.RowIndex).Cells(4).Value
'test....
End Sub

End Class