473,395 Members | 1,936 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

GetParentRow(s) or GetChildRows?

Could someone fill me in on the difference between the following three
DataRow methods:

GetParentRow
GetParentRows
GetChildRows

I'm guessing the difference between the first two is that one returns an
array while the other returns a single Row, which leads me to wonder, what
would happen if this option were used but there were more than one parent
row. On that note, in a relationship, what defines one row as a parent and
one as a child? Is it that multiple child fields can refer to a single parent
field and from this, the engine somehow deduces which side is the child and
which is the parent? From what I see above, it's possible for a table to have
multiple parents. How would this work? When you create a relation between
tables in a dataset, if you don't specify which side is which, what rules are
used to decide?

Thanks...
Jul 21 '05 #1
7 8175
Ben,
The parent & child is defined when you define the DataRelation object either
in code or via an XSD.

All three functions expect a DataRelation (either name or actual object) to
determine which relationship to resolve.

For a complete explanation of advanced features of Datasets, such as parent
rows & child rows, I would strongly recommend you read David Sceppa's book
"Microsoft ADO.NET - Core Reference" from MS Press. As it is a good tutorial
on ADO.NET as well as a good desk reference once you know ADO.NET.

Hope this helps
Jay

"Ben R." <Be**@discussions.microsoft.com> wrote in message
news:C1**********************************@microsof t.com...
Could someone fill me in on the difference between the following three
DataRow methods:

GetParentRow
GetParentRows
GetChildRows

I'm guessing the difference between the first two is that one returns an
array while the other returns a single Row, which leads me to wonder, what
would happen if this option were used but there were more than one parent
row. On that note, in a relationship, what defines one row as a parent and
one as a child? Is it that multiple child fields can refer to a single
parent
field and from this, the engine somehow deduces which side is the child
and
which is the parent? From what I see above, it's possible for a table to
have
multiple parents. How would this work? When you create a relation between
tables in a dataset, if you don't specify which side is which, what rules
are
used to decide?

Thanks...

Jul 21 '05 #2
Thanks for your reply, Jay. I think I'll grab a copy of that book. From what
I see, this is the definition of the "add" method for adding a new
datarelation:

Creates a DataRelation with a specified parent and child column, and adds it
to the collection.

Supported by the .NET Compact Framework.

[Visual Basic] Overloads Public Overridable Function Add(DataColumn,
DataColumn) As DataRelation
[C#] public virtual DataRelation Add(DataColumn, DataColumn);

It looks like the first column passed in will serve as the parent and the
second will serve as the child. Is this accurate? If so, does it make a
difference which one will be parent and which will be child? I was under the
impression that the child references data in the parent, but I could be
mistaken. I don't see why it should matter if you use GetChildRows or
GetParentRows becausefi you've got a starting point (a datarow) and a
direction to go in (a datarelation), there's really no ambiguity, so why do
you have to chose between these two choices?

-Ben

"Jay B. Harlow [MVP - Outlook]" wrote:
Ben,
The parent & child is defined when you define the DataRelation object either
in code or via an XSD.

All three functions expect a DataRelation (either name or actual object) to
determine which relationship to resolve.

For a complete explanation of advanced features of Datasets, such as parent
rows & child rows, I would strongly recommend you read David Sceppa's book
"Microsoft ADO.NET - Core Reference" from MS Press. As it is a good tutorial
on ADO.NET as well as a good desk reference once you know ADO.NET.

Hope this helps
Jay

"Ben R." <Be**@discussions.microsoft.com> wrote in message
news:C1**********************************@microsof t.com...
Could someone fill me in on the difference between the following three
DataRow methods:

GetParentRow
GetParentRows
GetChildRows

I'm guessing the difference between the first two is that one returns an
array while the other returns a single Row, which leads me to wonder, what
would happen if this option were used but there were more than one parent
row. On that note, in a relationship, what defines one row as a parent and
one as a child? Is it that multiple child fields can refer to a single
parent
field and from this, the engine somehow deduces which side is the child
and
which is the parent? From what I see above, it's possible for a table to
have
multiple parents. How would this work? When you create a relation between
tables in a dataset, if you don't specify which side is which, what rules
are
used to decide?

Thanks...


Jul 21 '05 #3
Ben,
For a 1 to Many relationship it definitely makes a difference.

Consider you have 2 tables: Orders & Order Details.

Which table would you expect to be the Parent?

Which table would you expect to be the Child?
For a Many to Many relationship it physically doesn't make a difference,
however it may logically make a difference.

The following thread has an example of creating 2 tables that have a Many to
Many relationship & use of GetParentRows. Hopefully there is enough there to
give you ideas...

http://groups-beta.google.com/group/...2f4a68079a57a8

If the link is broke, search groups.google.com for "Adding a column to a
dataset" from about 24 June 2004 in the microsoft.public.dotnet.languages.vb
newsgroup.

Hope this helps
Jay

"Ben R." <Be**@discussions.microsoft.com> wrote in message
news:B3**********************************@microsof t.com...
Thanks for your reply, Jay. I think I'll grab a copy of that book. From
what
I see, this is the definition of the "add" method for adding a new
datarelation:

Creates a DataRelation with a specified parent and child column, and adds
it
to the collection.

Supported by the .NET Compact Framework.

[Visual Basic] Overloads Public Overridable Function Add(DataColumn,
DataColumn) As DataRelation
[C#] public virtual DataRelation Add(DataColumn, DataColumn);

It looks like the first column passed in will serve as the parent and the
second will serve as the child. Is this accurate? If so, does it make a
difference which one will be parent and which will be child? I was under
the
impression that the child references data in the parent, but I could be
mistaken. I don't see why it should matter if you use GetChildRows or
GetParentRows becausefi you've got a starting point (a datarow) and a
direction to go in (a datarelation), there's really no ambiguity, so why
do
you have to chose between these two choices?

-Ben

"Jay B. Harlow [MVP - Outlook]" wrote:
Ben,
The parent & child is defined when you define the DataRelation object
either
in code or via an XSD.

All three functions expect a DataRelation (either name or actual object)
to
determine which relationship to resolve.

For a complete explanation of advanced features of Datasets, such as
parent
rows & child rows, I would strongly recommend you read David Sceppa's
book
"Microsoft ADO.NET - Core Reference" from MS Press. As it is a good
tutorial
on ADO.NET as well as a good desk reference once you know ADO.NET.

Hope this helps
Jay

"Ben R." <Be**@discussions.microsoft.com> wrote in message
news:C1**********************************@microsof t.com...
> Could someone fill me in on the difference between the following three
> DataRow methods:
>
> GetParentRow
> GetParentRows
> GetChildRows
>
> I'm guessing the difference between the first two is that one returns
> an
> array while the other returns a single Row, which leads me to wonder,
> what
> would happen if this option were used but there were more than one
> parent
> row. On that note, in a relationship, what defines one row as a parent
> and
> one as a child? Is it that multiple child fields can refer to a single
> parent
> field and from this, the engine somehow deduces which side is the child
> and
> which is the parent? From what I see above, it's possible for a table
> to
> have
> multiple parents. How would this work? When you create a relation
> between
> tables in a dataset, if you don't specify which side is which, what
> rules
> are
> used to decide?
>
> Thanks...


Jul 21 '05 #4
Hi Jay,

From the two examples you gave me, the one-to-many example is probably more
straightforward, so I'll focus on that. In a customers / orders example, it's
intuitively clear to me that in a relationship between the two, the customers
table is the parent and the orders table is the child. To me, I assume this
because for one customer, there can be multiple orders. I've been looking for
a formal definition of the two, but unsuccessfully. I guess what I'm trying
to gather is, in this circumstance, when you create and add the relationship
between customers and orders, does the add method assume that the first
column parameter will be the parent and the second will be the child? Is
there something within the relationship to mark the two tables, one as parent
and one as child, or is it more of an intrinsic quality that is merely
implied based on the circumstance (one to many, in this case)? Otherwise,
might you decide which table fills which role and get behavioural
differences? I subscribe to books24x7 and was looking through the book you
recommended. There's some good stuff, but not too much on comparing the
GetChildRows and GetParentRows methods. Thanks for the Clarification, Jay...

-Ben

"Jay B. Harlow [MVP - Outlook]" wrote:
Ben,
For a 1 to Many relationship it definitely makes a difference.

Consider you have 2 tables: Orders & Order Details.

Which table would you expect to be the Parent?

Which table would you expect to be the Child?
For a Many to Many relationship it physically doesn't make a difference,
however it may logically make a difference.

The following thread has an example of creating 2 tables that have a Many to
Many relationship & use of GetParentRows. Hopefully there is enough there to
give you ideas...

http://groups-beta.google.com/group/...2f4a68079a57a8

If the link is broke, search groups.google.com for "Adding a column to a
dataset" from about 24 June 2004 in the microsoft.public.dotnet.languages.vb
newsgroup.

Hope this helps
Jay

"Ben R." <Be**@discussions.microsoft.com> wrote in message
news:B3**********************************@microsof t.com...
Thanks for your reply, Jay. I think I'll grab a copy of that book. From
what
I see, this is the definition of the "add" method for adding a new
datarelation:

Creates a DataRelation with a specified parent and child column, and adds
it
to the collection.

Supported by the .NET Compact Framework.

[Visual Basic] Overloads Public Overridable Function Add(DataColumn,
DataColumn) As DataRelation
[C#] public virtual DataRelation Add(DataColumn, DataColumn);

It looks like the first column passed in will serve as the parent and the
second will serve as the child. Is this accurate? If so, does it make a
difference which one will be parent and which will be child? I was under
the
impression that the child references data in the parent, but I could be
mistaken. I don't see why it should matter if you use GetChildRows or
GetParentRows becausefi you've got a starting point (a datarow) and a
direction to go in (a datarelation), there's really no ambiguity, so why
do
you have to chose between these two choices?

-Ben

"Jay B. Harlow [MVP - Outlook]" wrote:
Ben,
The parent & child is defined when you define the DataRelation object
either
in code or via an XSD.

All three functions expect a DataRelation (either name or actual object)
to
determine which relationship to resolve.

For a complete explanation of advanced features of Datasets, such as
parent
rows & child rows, I would strongly recommend you read David Sceppa's
book
"Microsoft ADO.NET - Core Reference" from MS Press. As it is a good
tutorial
on ADO.NET as well as a good desk reference once you know ADO.NET.

Hope this helps
Jay

"Ben R." <Be**@discussions.microsoft.com> wrote in message
news:C1**********************************@microsof t.com...
> Could someone fill me in on the difference between the following three
> DataRow methods:
>
> GetParentRow
> GetParentRows
> GetChildRows
>
> I'm guessing the difference between the first two is that one returns
> an
> array while the other returns a single Row, which leads me to wonder,
> what
> would happen if this option were used but there were more than one
> parent
> row. On that note, in a relationship, what defines one row as a parent
> and
> one as a child? Is it that multiple child fields can refer to a single
> parent
> field and from this, the engine somehow deduces which side is the child
> and
> which is the parent? From what I see above, it's possible for a table
> to
> have
> multiple parents. How would this work? When you create a relation
> between
> tables in a dataset, if you don't specify which side is which, what
> rules
> are
> used to decide?
>
> Thanks...


Jul 21 '05 #5
Ben,
does the add method assume that the first
column parameter will be the parent and the second will be the child? Why would it assume anything??? Did you read the documentation itself???

http://msdn.microsoft.com/library/de...sAddTopic2.asp

[Visual Basic]
Overloads Public Overridable Function Add( _
ByVal parentColumn As DataColumn, _
ByVal childColumn As DataColumn _
) As DataRelation
[C#]
public virtual DataRelation Add(
DataColumn parentColumn,
DataColumn childColumn
);

The first column *IS* the parent, the second *IS* the child... I'm really
not sure what you are reading that does not include the names of the
parameters, the names of the parameters clearly indicate which is the parent
& which is the child!

Hope this helps
Jay

"Ben R." <Be**@discussions.microsoft.com> wrote in message
news:F9**********************************@microsof t.com... Hi Jay,

From the two examples you gave me, the one-to-many example is probably
more
straightforward, so I'll focus on that. In a customers / orders example,
it's
intuitively clear to me that in a relationship between the two, the
customers
table is the parent and the orders table is the child. To me, I assume
this
because for one customer, there can be multiple orders. I've been looking
for
a formal definition of the two, but unsuccessfully. I guess what I'm
trying
to gather is, in this circumstance, when you create and add the
relationship
between customers and orders, does the add method assume that the first
column parameter will be the parent and the second will be the child? Is
there something within the relationship to mark the two tables, one as
parent
and one as child, or is it more of an intrinsic quality that is merely
implied based on the circumstance (one to many, in this case)? Otherwise,
might you decide which table fills which role and get behavioural
differences? I subscribe to books24x7 and was looking through the book you
recommended. There's some good stuff, but not too much on comparing the
GetChildRows and GetParentRows methods. Thanks for the Clarification,
Jay...

-Ben

"Jay B. Harlow [MVP - Outlook]" wrote:
Ben,
For a 1 to Many relationship it definitely makes a difference.

Consider you have 2 tables: Orders & Order Details.

Which table would you expect to be the Parent?

Which table would you expect to be the Child?
For a Many to Many relationship it physically doesn't make a difference,
however it may logically make a difference.

The following thread has an example of creating 2 tables that have a Many
to
Many relationship & use of GetParentRows. Hopefully there is enough there
to
give you ideas...

http://groups-beta.google.com/group/...2f4a68079a57a8

If the link is broke, search groups.google.com for "Adding a column to a
dataset" from about 24 June 2004 in the
microsoft.public.dotnet.languages.vb
newsgroup.

Hope this helps
Jay

"Ben R." <Be**@discussions.microsoft.com> wrote in message
news:B3**********************************@microsof t.com...
> Thanks for your reply, Jay. I think I'll grab a copy of that book. From
> what
> I see, this is the definition of the "add" method for adding a new
> datarelation:
>
> Creates a DataRelation with a specified parent and child column, and
> adds
> it
> to the collection.
>
> Supported by the .NET Compact Framework.
>
> [Visual Basic] Overloads Public Overridable Function Add(DataColumn,
> DataColumn) As DataRelation
> [C#] public virtual DataRelation Add(DataColumn, DataColumn);
>
> It looks like the first column passed in will serve as the parent and
> the
> second will serve as the child. Is this accurate? If so, does it make a
> difference which one will be parent and which will be child? I was
> under
> the
> impression that the child references data in the parent, but I could be
> mistaken. I don't see why it should matter if you use GetChildRows or
> GetParentRows becausefi you've got a starting point (a datarow) and a
> direction to go in (a datarelation), there's really no ambiguity, so
> why
> do
> you have to chose between these two choices?
>
> -Ben
>
> "Jay B. Harlow [MVP - Outlook]" wrote:
>
>> Ben,
>> The parent & child is defined when you define the DataRelation object
>> either
>> in code or via an XSD.
>>
>> All three functions expect a DataRelation (either name or actual
>> object)
>> to
>> determine which relationship to resolve.
>>
>> For a complete explanation of advanced features of Datasets, such as
>> parent
>> rows & child rows, I would strongly recommend you read David Sceppa's
>> book
>> "Microsoft ADO.NET - Core Reference" from MS Press. As it is a good
>> tutorial
>> on ADO.NET as well as a good desk reference once you know ADO.NET.
>>
>> Hope this helps
>> Jay
>>
>> "Ben R." <Be**@discussions.microsoft.com> wrote in message
>> news:C1**********************************@microsof t.com...
>> > Could someone fill me in on the difference between the following
>> > three
>> > DataRow methods:
>> >
>> > GetParentRow
>> > GetParentRows
>> > GetChildRows
>> >
>> > I'm guessing the difference between the first two is that one
>> > returns
>> > an
>> > array while the other returns a single Row, which leads me to
>> > wonder,
>> > what
>> > would happen if this option were used but there were more than one
>> > parent
>> > row. On that note, in a relationship, what defines one row as a
>> > parent
>> > and
>> > one as a child? Is it that multiple child fields can refer to a
>> > single
>> > parent
>> > field and from this, the engine somehow deduces which side is the
>> > child
>> > and
>> > which is the parent? From what I see above, it's possible for a
>> > table
>> > to
>> > have
>> > multiple parents. How would this work? When you create a relation
>> > between
>> > tables in a dataset, if you don't specify which side is which, what
>> > rules
>> > are
>> > used to decide?
>> >
>> > Thanks...
>>
>>
>>


Jul 21 '05 #6
Sorry about that, Jay. I was looking at the overload list. Thanks for your
help...

-Ben

"Jay B. Harlow [MVP - Outlook]" wrote:
Ben,
does the add method assume that the first
column parameter will be the parent and the second will be the child?

Why would it assume anything??? Did you read the documentation itself???

http://msdn.microsoft.com/library/de...sAddTopic2.asp

[Visual Basic]
Overloads Public Overridable Function Add( _
ByVal parentColumn As DataColumn, _
ByVal childColumn As DataColumn _
) As DataRelation
[C#]
public virtual DataRelation Add(
DataColumn parentColumn,
DataColumn childColumn
);

The first column *IS* the parent, the second *IS* the child... I'm really
not sure what you are reading that does not include the names of the
parameters, the names of the parameters clearly indicate which is the parent
& which is the child!

Hope this helps
Jay

"Ben R." <Be**@discussions.microsoft.com> wrote in message
news:F9**********************************@microsof t.com...
Hi Jay,

From the two examples you gave me, the one-to-many example is probably
more
straightforward, so I'll focus on that. In a customers / orders example,
it's
intuitively clear to me that in a relationship between the two, the
customers
table is the parent and the orders table is the child. To me, I assume
this
because for one customer, there can be multiple orders. I've been looking
for
a formal definition of the two, but unsuccessfully. I guess what I'm
trying
to gather is, in this circumstance, when you create and add the
relationship
between customers and orders, does the add method assume that the first
column parameter will be the parent and the second will be the child? Is
there something within the relationship to mark the two tables, one as
parent
and one as child, or is it more of an intrinsic quality that is merely
implied based on the circumstance (one to many, in this case)? Otherwise,
might you decide which table fills which role and get behavioural
differences? I subscribe to books24x7 and was looking through the book you
recommended. There's some good stuff, but not too much on comparing the
GetChildRows and GetParentRows methods. Thanks for the Clarification,
Jay...

-Ben

"Jay B. Harlow [MVP - Outlook]" wrote:
Ben,
For a 1 to Many relationship it definitely makes a difference.

Consider you have 2 tables: Orders & Order Details.

Which table would you expect to be the Parent?

Which table would you expect to be the Child?
For a Many to Many relationship it physically doesn't make a difference,
however it may logically make a difference.

The following thread has an example of creating 2 tables that have a Many
to
Many relationship & use of GetParentRows. Hopefully there is enough there
to
give you ideas...

http://groups-beta.google.com/group/...2f4a68079a57a8

If the link is broke, search groups.google.com for "Adding a column to a
dataset" from about 24 June 2004 in the
microsoft.public.dotnet.languages.vb
newsgroup.

Hope this helps
Jay

"Ben R." <Be**@discussions.microsoft.com> wrote in message
news:B3**********************************@microsof t.com...
> Thanks for your reply, Jay. I think I'll grab a copy of that book. From
> what
> I see, this is the definition of the "add" method for adding a new
> datarelation:
>
> Creates a DataRelation with a specified parent and child column, and
> adds
> it
> to the collection.
>
> Supported by the .NET Compact Framework.
>
> [Visual Basic] Overloads Public Overridable Function Add(DataColumn,
> DataColumn) As DataRelation
> [C#] public virtual DataRelation Add(DataColumn, DataColumn);
>
> It looks like the first column passed in will serve as the parent and
> the
> second will serve as the child. Is this accurate? If so, does it make a
> difference which one will be parent and which will be child? I was
> under
> the
> impression that the child references data in the parent, but I could be
> mistaken. I don't see why it should matter if you use GetChildRows or
> GetParentRows becausefi you've got a starting point (a datarow) and a
> direction to go in (a datarelation), there's really no ambiguity, so
> why
> do
> you have to chose between these two choices?
>
> -Ben
>
> "Jay B. Harlow [MVP - Outlook]" wrote:
>
>> Ben,
>> The parent & child is defined when you define the DataRelation object
>> either
>> in code or via an XSD.
>>
>> All three functions expect a DataRelation (either name or actual
>> object)
>> to
>> determine which relationship to resolve.
>>
>> For a complete explanation of advanced features of Datasets, such as
>> parent
>> rows & child rows, I would strongly recommend you read David Sceppa's
>> book
>> "Microsoft ADO.NET - Core Reference" from MS Press. As it is a good
>> tutorial
>> on ADO.NET as well as a good desk reference once you know ADO.NET.
>>
>> Hope this helps
>> Jay
>>
>> "Ben R." <Be**@discussions.microsoft.com> wrote in message
>> news:C1**********************************@microsof t.com...
>> > Could someone fill me in on the difference between the following
>> > three
>> > DataRow methods:
>> >
>> > GetParentRow
>> > GetParentRows
>> > GetChildRows
>> >
>> > I'm guessing the difference between the first two is that one
>> > returns
>> > an
>> > array while the other returns a single Row, which leads me to
>> > wonder,
>> > what
>> > would happen if this option were used but there were more than one
>> > parent
>> > row. On that note, in a relationship, what defines one row as a
>> > parent
>> > and
>> > one as a child? Is it that multiple child fields can refer to a
>> > single
>> > parent
>> > field and from this, the engine somehow deduces which side is the
>> > child
>> > and
>> > which is the parent? From what I see above, it's possible for a
>> > table
>> > to
>> > have
>> > multiple parents. How would this work? When you create a relation
>> > between
>> > tables in a dataset, if you don't specify which side is which, what
>> > rules
>> > are
>> > used to decide?
>> >
>> > Thanks...
>>
>>
>>


Jul 21 '05 #7
Ben,
No problem.

Unfortunately the overload list is too high of detail, you need to "zoom" in
to each specific function for the actual details...

Hope this helps
Jay

"Ben R." <Be**@discussions.microsoft.com> wrote in message
news:57**********************************@microsof t.com...
Sorry about that, Jay. I was looking at the overload list. Thanks for your
help...

-Ben

"Jay B. Harlow [MVP - Outlook]" wrote:
Ben,
> does the add method assume that the first
> column parameter will be the parent and the second will be the child?

Why would it assume anything??? Did you read the documentation itself???

http://msdn.microsoft.com/library/de...sAddTopic2.asp

[Visual Basic]
Overloads Public Overridable Function Add( _
ByVal parentColumn As DataColumn, _
ByVal childColumn As DataColumn _
) As DataRelation
[C#]
public virtual DataRelation Add(
DataColumn parentColumn,
DataColumn childColumn
);

The first column *IS* the parent, the second *IS* the child... I'm really
not sure what you are reading that does not include the names of the
parameters, the names of the parameters clearly indicate which is the
parent
& which is the child!

Hope this helps
Jay

"Ben R." <Be**@discussions.microsoft.com> wrote in message
news:F9**********************************@microsof t.com...
> Hi Jay,
>
> From the two examples you gave me, the one-to-many example is probably
> more
> straightforward, so I'll focus on that. In a customers / orders
> example,
> it's
> intuitively clear to me that in a relationship between the two, the
> customers
> table is the parent and the orders table is the child. To me, I assume
> this
> because for one customer, there can be multiple orders. I've been
> looking
> for
> a formal definition of the two, but unsuccessfully. I guess what I'm
> trying
> to gather is, in this circumstance, when you create and add the
> relationship
> between customers and orders, does the add method assume that the first
> column parameter will be the parent and the second will be the child?
> Is
> there something within the relationship to mark the two tables, one as
> parent
> and one as child, or is it more of an intrinsic quality that is merely
> implied based on the circumstance (one to many, in this case)?
> Otherwise,
> might you decide which table fills which role and get behavioural
> differences? I subscribe to books24x7 and was looking through the book
> you
> recommended. There's some good stuff, but not too much on comparing the
> GetChildRows and GetParentRows methods. Thanks for the Clarification,
> Jay...
>
> -Ben
>
> "Jay B. Harlow [MVP - Outlook]" wrote:
>
>> Ben,
>> For a 1 to Many relationship it definitely makes a difference.
>>
>> Consider you have 2 tables: Orders & Order Details.
>>
>> Which table would you expect to be the Parent?
>>
>> Which table would you expect to be the Child?
>>
>>
>> For a Many to Many relationship it physically doesn't make a
>> difference,
>> however it may logically make a difference.
>>
>> The following thread has an example of creating 2 tables that have a
>> Many
>> to
>> Many relationship & use of GetParentRows. Hopefully there is enough
>> there
>> to
>> give you ideas...
>>
>> http://groups-beta.google.com/group/...2f4a68079a57a8
>>
>> If the link is broke, search groups.google.com for "Adding a column to
>> a
>> dataset" from about 24 June 2004 in the
>> microsoft.public.dotnet.languages.vb
>> newsgroup.
>>
>> Hope this helps
>> Jay
>>
>> "Ben R." <Be**@discussions.microsoft.com> wrote in message
>> news:B3**********************************@microsof t.com...
>> > Thanks for your reply, Jay. I think I'll grab a copy of that book.
>> > From
>> > what
>> > I see, this is the definition of the "add" method for adding a new
>> > datarelation:
>> >
>> > Creates a DataRelation with a specified parent and child column, and
>> > adds
>> > it
>> > to the collection.
>> >
>> > Supported by the .NET Compact Framework.
>> >
>> > [Visual Basic] Overloads Public Overridable Function Add(DataColumn,
>> > DataColumn) As DataRelation
>> > [C#] public virtual DataRelation Add(DataColumn, DataColumn);
>> >
>> > It looks like the first column passed in will serve as the parent
>> > and
>> > the
>> > second will serve as the child. Is this accurate? If so, does it
>> > make a
>> > difference which one will be parent and which will be child? I was
>> > under
>> > the
>> > impression that the child references data in the parent, but I could
>> > be
>> > mistaken. I don't see why it should matter if you use GetChildRows
>> > or
>> > GetParentRows becausefi you've got a starting point (a datarow) and
>> > a
>> > direction to go in (a datarelation), there's really no ambiguity, so
>> > why
>> > do
>> > you have to chose between these two choices?
>> >
>> > -Ben
>> >
>> > "Jay B. Harlow [MVP - Outlook]" wrote:
>> >
>> >> Ben,
>> >> The parent & child is defined when you define the DataRelation
>> >> object
>> >> either
>> >> in code or via an XSD.
>> >>
>> >> All three functions expect a DataRelation (either name or actual
>> >> object)
>> >> to
>> >> determine which relationship to resolve.
>> >>
>> >> For a complete explanation of advanced features of Datasets, such
>> >> as
>> >> parent
>> >> rows & child rows, I would strongly recommend you read David
>> >> Sceppa's
>> >> book
>> >> "Microsoft ADO.NET - Core Reference" from MS Press. As it is a good
>> >> tutorial
>> >> on ADO.NET as well as a good desk reference once you know ADO.NET.
>> >>
>> >> Hope this helps
>> >> Jay
>> >>
>> >> "Ben R." <Be**@discussions.microsoft.com> wrote in message
>> >> news:C1**********************************@microsof t.com...
>> >> > Could someone fill me in on the difference between the following
>> >> > three
>> >> > DataRow methods:
>> >> >
>> >> > GetParentRow
>> >> > GetParentRows
>> >> > GetChildRows
>> >> >
>> >> > I'm guessing the difference between the first two is that one
>> >> > returns
>> >> > an
>> >> > array while the other returns a single Row, which leads me to
>> >> > wonder,
>> >> > what
>> >> > would happen if this option were used but there were more than
>> >> > one
>> >> > parent
>> >> > row. On that note, in a relationship, what defines one row as a
>> >> > parent
>> >> > and
>> >> > one as a child? Is it that multiple child fields can refer to a
>> >> > single
>> >> > parent
>> >> > field and from this, the engine somehow deduces which side is the
>> >> > child
>> >> > and
>> >> > which is the parent? From what I see above, it's possible for a
>> >> > table
>> >> > to
>> >> > have
>> >> > multiple parents. How would this work? When you create a relation
>> >> > between
>> >> > tables in a dataset, if you don't specify which side is which,
>> >> > what
>> >> > rules
>> >> > are
>> >> > used to decide?
>> >> >
>> >> > Thanks...
>> >>
>> >>
>> >>
>>
>>
>>


Jul 21 '05 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Kevin | last post by:
Hi All this is going to be a lengthy questions do please bear with me.... I have a database that has three tables - Employees, ShiftHeader,ShiftDetails Now the employees table holds the...
3
by: Darren Clark | last post by:
I am trying to understand typed datasets more.... and i am stuck on a little problem I have created a type dataset called "News" this consists of 2 tables. NewsTable and NewsTypes. the news has...
9
by: Marty McFly | last post by:
Greetings, I'm trying to let my users dynamically filter records from a table that relate to other tables. RELATIONSHIPS: . = . . = . There is a Many-to-Many relationship between...
16
by: Geoff Jones | last post by:
Hi Can anybody help me with the following, hopefully simple, question? I have a table which I've connected to a dataset. I wish to add a new column to the beginning of the table and to fill...
5
by: Geoff Jones | last post by:
Hi I have question regarding times and dates in a datatable. I have one table with one column having the date e.g.03/09/04, and another column other the time 08:03:05. The other table has one...
7
by: Ben R. | last post by:
Could someone fill me in on the difference between the following three DataRow methods: GetParentRow GetParentRows GetChildRows I'm guessing the difference between the first two is that one...
1
by: Ronald S. Cook | last post by:
Let's say I have 2 ADO.NET DataTables (tblAuthor and tblBook) within an ADO.NET DataSet (dstPublish). tblAuthor has DataColumns AuthorID and AuthorName, tblBook has DataColumns BookID,...
1
by: delusion7 | last post by:
I'm really lost right now, I can't figure out how to pass to values from a table back to the presentationTier. I am searching by the value selected in the parent(carSize) using a comboBox and passing...
5
by: =?Utf-8?B?RnJhbmsgVXJheQ==?= | last post by:
Hi all I have a DataSet with 2 tables. Now I want to select data like a INNER JOIN from these tables. In SQL Syntax I would write: SELECT * FROM table1 t1 INNER JOIN table2 t2 ON t1.f1 =...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.