For Each row As DataGridViewRow In dgvUserDetails.Rows If row.Index < dgvUserDetails.Rows.Count - 1 Then Dim cmbprof As New DataGridViewComboBoxCell() dgvUserDetails.Rows(row.Index).Cells(8) = cmbprof sql = "Select Description from Category where Catgry = 5" If rs.State = 1 Then rs.Close() rs.Open(sql, MainCon, 1, 3) Do While Not rs.EOF cmbprof.Items.Add(rs.Fields(0).Value) rs.MoveNext() Loop sql = "Select Prof from datafile where Part_No = " & dgvUserDetails.Item("Baaga", row.Index).Value & " and SLNOINPART= " & dgvUserDetails.Item("emaaMk", row.Index).Value & "" If rs.State = 1 Then rs.Close() rs.Open(sql, MainCon, 1, 3) If Not rs.EOF Then If Not IsDBNull(rs.Fields(0).Value) Then gProf = rs.Fields(0).Value cmbprof.DisplayMember = "Prof" cmbprof.Value = gProf End If End If End If Next
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)