|
-
Sep 26th, 2017, 12:44 PM
#1
Thread Starter
Fanatic Member
[RESOLVED] display DGV list from more than one table
I have the following DataGridView.

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?
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|