25-08-13, 03:54 PM
جرب هذا الكود (طبعا بطريقة الكود)
كود :
Private Sub DataGridView1_SelectionChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles DataGridView1.SelectionChanged
Try
txtshowname.Text = ""
lst_show.Items.Clear()
Dim sql As String = "Select * From [table1] Where [name]='" & DataGridView1.Rows(DataGridView1.CurrentRow.Index).Cells(0).Value & "'"
Dim da As New OleDb.OleDbDataAdapter(sql, con)
Dim dt As New DataTable
da.Fill(dt)
txtshowname.Text = dt.Rows(0).Item("name")
lst_show.Items.AddRange(dt.Rows(0).Item("units").Split(", "))
Catch ex As Exception
End Try
End Sub