DataRelation Question

  • Thread starter Thread starter Rick
  • Start date Start date
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
 
yes. Cascading behavior is only intended for updates and deletes.



Greg Jackson
Pdx, Oregon
 
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
 
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
 
Back
Top