With conn
If .State = ConnectionState.Open Then .Close()
.Open()
End With
sqlSel = "Select [IdEmp],[Name] From [tbl_Employee]"
da = New SqlDataAdapter(sqlSel, conn)
da.Fill(ds, "Reload")
For i As Integer = 0 To ds.Tables("Reload").Rows.Count - 1
dgv.Rows(i).Cells(i).Value = i ' ตอน i =1 แล้วมันหยุดอยู่ตรงนี้อะคะ
dgv.Rows(i).Cells(i + 1).Value = ds.Tables("Reload").Rows(0)("IdEmp")
dgv.Rows(i).Cells(i + 2).Value = ds.Tables("Reload").Rows(0)("Name")
Next
call fill_grid(employ)
-----------------------
Sub fill_grid(ByVal grid As GridView)
Dim ds As New DataSet()
Dim sqlDataAdapter As New Data.SqlClient.SqlDataAdapter("Select Id as 'No. ', Emp as N' รหัสพนักงาน ', Name as N' ชื่อ - สกุล ' From [tbl_Employee]", sqlConn)
sqlDataAdapter.Fill(ds, "table")
With grid : .DataSource = ab.Tables("table") : .DataBind() : End With
ds= Nothing
End Sub