DataRelation Question

R

Rick

Hello,

I have created a typed dataset with two tables. These tables has a one to
many relationship (via key) which I represent with a datarelation. The
question I have is how can I cascade the key value from the parent to the
child on a new inserted row? Does cascading only work on update and delete?
If so, is the only choice to manually add the key to the child table?

Thanks
 
J

Jaxon

yes. Cascading behavior is only intended for updates and deletes.



Greg Jackson
Pdx, Oregon
 
R

Rick

Thanks, so since I have to do it manually. Is there a suggested method? Do
I create eventhandlers for the added row? I am using a Guid for my key and
I need to pass it around to a few tables. Any suggestions?

Thanks
 
J

Jaxon

not sure exactly what your question is.....

you want to know how to create a child record in a datatable that is related
to a parent datatable in a DataSet ?

In SQL Server you could maintain this logic in a stored procedure or you
could use Triggers in SQL Server to do this ( I recommend not using
triggers).

In ADO.NET whereever your code adds to the parent you could technically just
add the child\children at the same time....

not exactly sure what your situation is.....



GAJ
 

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