How DataRelation object is updated

G

Guest

After the VS 2003 creates a strongly typed DataSet object that contains a
couple of tables and serveral many-to-may data relations among all the
tables, and the data got populated, I am wonder how the DataRelation object
of the DataSet object is updated when some new rows are added to some of the
tables. Do I have to update the relation of the added rows or in somewhere
the relations are added automatically? Can someone explain this for me or
point me to some resources?

Thanks a lots.
 
G

Guest

Say, I have two related tables that are populated to a stringly typed DataSet
object (created by Visual Studio 2003), including their relationship (foreign
key). So that I have a DataSet object that contains two DataTable objects and
at least a DataRelationCollection object, and some others. If I add two new
and related rows, one to each table, I expect that a new relation object is
add autmoatically to the DataRelationCollection object by some mechanism also
generated the VS 2003, but not by some logics that have to be written by
myself. I just want to confirm this because I could not find an explanation
of how to handle data relation within (strongly typed) DataSet from MSDN
library. Did I explain this clearly? Thanks.

Miha Markic said:
hi,

What do you mean by updating the relation?

--
Miha Markic [MVP C#] - RightHand .NET consulting & development
www.rthand.com
Blog: http://cs.rthand.com/blogs/blog_with_righthand/
SLODUG - Slovene Developer Users Group www.codezone-si.info

DHuang said:
After the VS 2003 creates a strongly typed DataSet object that contains a
couple of tables and serveral many-to-may data relations among all the
tables, and the data got populated, I am wonder how the DataRelation
object
of the DataSet object is updated when some new rows are added to some of
the
tables. Do I have to update the relation of the added rows or in somewhere
the relations are added automatically? Can someone explain this for me or
point me to some resources?

Thanks a lots.
 
M

Massimo

Say, I have two related tables that are populated to a stringly typed
DataSet
object (created by Visual Studio 2003), including their relationship
(foreign
key). So that I have a DataSet object that contains two DataTable objects
and
at least a DataRelationCollection object, and some others. If I add two
new
and related rows, one to each table, I expect that a new relation object
is
add autmoatically to the DataRelationCollection object by some mechanism
also
generated the VS 2003, but not by some logics that have to be written by
myself. I just want to confirm this because I could not find an
explanation
of how to handle data relation within (strongly typed) DataSet from MSDN
library. Did I explain this clearly? Thanks.

A DataRelation object links two tables, not their rows one-by-one. You must
not add new DataRelations everytime you add a row to a table.

Massimo
 

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