Private Sub CellClick(sender As System.Object, e As System.Windows.Forms.DataGridViewCellEventArgs) Handles DataGridView1.CellClick
Try
Dim i As Integer = DataGridView1.Item(0, e.RowIndex).Value
obj.ExecuteSQL = "select * FROM mAdmin, mLevelUser WHERE mAdmin.LevelUser_id=mLevelUser.LevelUser_id AND Admin_id = " & SQ(i)
If obj.ExecuteSQL = True Then
txtNo.Text = obj.getField("Admin_id")
txtName.Text = obj.getField("Admin_name")
txtUser.Text = obj.getField("Admin_user")
txtPass.Text = obj.getField("Admin_pass")
ComboBoxEx1.Text = obj.getField("LevelUser_name")
lodeCbo()
End If
Catch ex As Exception
End Try
End Sub
Tag : .NET, Ms SQL Server 2008, Win (Windows App), VS 2010 (.NET 4.x)
If (e.RowIndex) = -1 Then Exit Sub
With DGCProduct.Rows(e.RowIndex)
txtNo.Text = CStr(.Cells(0).Value)
txtName.Text = CStr(.Cells(1).Value)
txtUser.Text = CStr(.Cells(2).Value)
txtPass.Text = Cstr(.Cells(3).Values)
End With