I have the following DataGridView.

Name:  DGV.jpg
Views: 893
Size:  16.8 KB

This DGV is designed to display a list of people from either of two different tables in a database. In the DGV properties Window I created the columns shown in the DGV above. Since there could be either of two tables used I cannot set the Data Source and Data Member properties in the properties window (can I?).

I am aware of how one would approach this if instead of the DGV I had a set of textboxes/labels that I wanted to display:

'Form controls databound to tblChangeApprove.
Me.TblChangeApproveTableAdapter.FillByChangeIDLogin(Me._MasterBase4_0ItemMasterDataSet.tblChangeAppr ove, glbintCRNum, glbstrLogin)
With lblChangeID
.DataBindings.Add("Text", tblChangeApproveBindingSource, "intChangeID")
End With
With lblName
.DataBindings.Add("Text", tblChangeApproveBindingSource, "strName")
End With
With lblJobTitle
.DataBindings.Add("Text", tblChangeApproveBindingSource, "strJobTitle")
End With
With lblDepartment
.DataBindings.Add("Text", tblChangeApproveBindingSource, "strDept")
End With
With txtSignature
.DataBindings.Add("Text", tblChangeApproveBindingSource, "strSignature")
End With
End Sub

I know that some of you do not like using With/EndWith, but I do. Anyway, it is clear to me that this is not the approach one would take with a DGV. I have attempted a number of different command approaches for the DGV with no success. Could someone provide me with the syntax used to call the collection from the table and display them in the DGV?