I have a DataGridView with 3 TextBox columns and 1 ComboBox column. I have tried without result to populate the ComboBox column with data from other table, a suggestion will be apreciated.
This is the code
Dim conn As OleDb.OleDbConnection = DBConnect.getDbConnection()
dgv.Rows.Clear()
Try
Dim selectSql = "select idf,cb,rgso from libroacquisti "
Dim da As OleDb.OleDbDataAdapter = New OleDb.OleDbDataAdapter(selectSql, conn)
Dim ds As DataSet = New DataSet
da.Fill(ds, "Libroacquisti")
Dim dt As DataTable = ds.Tables("libroacquisti")
Dim row As DataRow
If dt.Rows.Count > 0 Then
For Each row In dt.Rows
Me.dgv.Rows.Add(row("idf"),row("cb"), row("rgso"),THIS IS COMBOBOX COLUMN AND I SHOULD WANT TO POPULATE IT FROM ANOTHER TABLE BY SQL QUERY )
Next row
End If
However, it must be considered that in each row of the DataGridView, in the related ComboBox, the data are always the same and are extracted from the same table.