Specify Multiple Column Relationship

W

Wayne Wengert

I am trying to relate two tables in a dataset but cannot find the right
syntax to specify that the relationship consists of two columns. The
following code specifies a single column but I need to add a 2nd column
("SeqNbr") to that to specify a unique relation?

Dim ShowSetsRel As DataRelation = ds1.Relations.Add("ShowSets", _

ds1.Tables("CGShows").Columns("EventID"), _

ds1.Tables("CGPerfSched").Columns("EventID"))
 
W

Wayne Wengert

Thanks William - That was a quick response. I would never have figured that
out without the pointer - Looks like it works now.

FYI, there are a couple of typos in the section shown here (Colum should be
"Column" and "DetailColumns = New DataColumns()" should be "DetailColumn =
New DataColumns()"

===========================================
TransactionColumns = New DataColum(){ds.Tables(0).Columns("TransID"),
ds.Tables(0).Columns("CustomerID"), ds.Tables(0).Columns("SalePersonID")}
DetailColumns = New DataColumns(){ds.Tables(1).Columns("TransID"),
ds.Tables(1).Columns("CustomerID"), ds.Tables(1).Columns("SalesPersonID")}
===========================================


Wayne
 
W

Wayne Wengert

That second typo is " New DataColumns" that should be "New DataColumn"

Sorry about that.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top