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"))

Re: Specify Multiple Column Relationship by William

William
Wed Jul 07 09:11:56 CDT 2004

Here's an example. If you have multiple columns, then use an Array of Data
Columns http://www.knowdotnet.com/articles/datarelation-printable.html

--

W.G. Ryan, eMVP

Have an opinion on the effectiveness of Microsoft Embedded newsgroups?
Let Microsoft know!
https://www.windowsembeddedeval.com/community/newsgroups
"Wayne Wengert" <wayneDONTWANTSPAM@wengert.com> wrote in message
news:%23n2lhrCZEHA.2500@TK2MSFTNGP09.phx.gbl...
> 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"))
>
>



Re: Specify Multiple Column Relationship by Wayne

Wayne
Wed Jul 07 09:35:36 CDT 2004

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

"William Ryan eMVP" <dotnetguru@comcast.nospam.net> wrote in message
news:O6UKouCZEHA.3480@TK2MSFTNGP11.phx.gbl...
> Here's an example. If you have multiple columns, then use an Array of
Data
> Columns http://www.knowdotnet.com/articles/datarelation-printable.html
>
> --
>
> W.G. Ryan, eMVP
>
> Have an opinion on the effectiveness of Microsoft Embedded newsgroups?
> Let Microsoft know!
> https://www.windowsembeddedeval.com/community/newsgroups
> "Wayne Wengert" <wayneDONTWANTSPAM@wengert.com> wrote in message
> news:%23n2lhrCZEHA.2500@TK2MSFTNGP09.phx.gbl...
> > 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"))
> >
> >
>
>



My Typo by Wayne

Wayne
Wed Jul 07 09:44:36 CDT 2004

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

Sorry about that.


"Wayne Wengert" <wayneDONTWANTSPAM@wengert.com> wrote in message
news:uaz3z%23CZEHA.1248@TK2MSFTNGP11.phx.gbl...
> 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
>
> "William Ryan eMVP" <dotnetguru@comcast.nospam.net> wrote in message
> news:O6UKouCZEHA.3480@TK2MSFTNGP11.phx.gbl...
> > Here's an example. If you have multiple columns, then use an Array of
> Data
> > Columns http://www.knowdotnet.com/articles/datarelation-printable.html
> >
> > --
> >
> > W.G. Ryan, eMVP
> >
> > Have an opinion on the effectiveness of Microsoft Embedded newsgroups?
> > Let Microsoft know!
> > https://www.windowsembeddedeval.com/community/newsgroups
> > "Wayne Wengert" <wayneDONTWANTSPAM@wengert.com> wrote in message
> > news:%23n2lhrCZEHA.2500@TK2MSFTNGP09.phx.gbl...
> > > 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"))
> > >
> > >
> >
> >
>
>



Re: My Typo by William

William
Wed Jul 07 10:46:41 CDT 2004

Thanks Wayne - Sorry about that. I really need to run those things through
Word's spell checked ;-)

--

W.G. Ryan, eMVP

Have an opinion on the effectiveness of Microsoft Embedded newsgroups?
Let Microsoft know!
https://www.windowsembeddedeval.com/community/newsgroups
"Wayne Wengert" <wayneDONTWANTSPAM@wengert.com> wrote in message
news:uohy1DDZEHA.3012@tk2msftngp13.phx.gbl...
> That second typo is " New DataColumns" that should be "New DataColumn"
>
> Sorry about that.
>
>
> "Wayne Wengert" <wayneDONTWANTSPAM@wengert.com> wrote in message
> news:uaz3z%23CZEHA.1248@TK2MSFTNGP11.phx.gbl...
> > 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
> >
> > "William Ryan eMVP" <dotnetguru@comcast.nospam.net> wrote in message
> > news:O6UKouCZEHA.3480@TK2MSFTNGP11.phx.gbl...
> > > Here's an example. If you have multiple columns, then use an Array of
> > Data
> > > Columns http://www.knowdotnet.com/articles/datarelation-printable.html
> > >
> > > --
> > >
> > > W.G. Ryan, eMVP
> > >
> > > Have an opinion on the effectiveness of Microsoft Embedded newsgroups?
> > > Let Microsoft know!
> > > https://www.windowsembeddedeval.com/community/newsgroups
> > > "Wayne Wengert" <wayneDONTWANTSPAM@wengert.com> wrote in message
> > > news:%23n2lhrCZEHA.2500@TK2MSFTNGP09.phx.gbl...
> > > > 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"))
> > > >
> > > >
> > >
> > >
> >
> >
>
>