Hi,
I have a strongly typed dataset with 15-20 tables which have typed
relationships such as:
Customers-Orders
Orders-OrderDetails
OrderDetails-ProductDetails
etc...
I am using auto-increment values for every record that is added, and
replacing them with an SQL IDENTITY() value. This all works fine except for
when it comes to adding a child record via a currency manager. The parent
"id" does not seem to propagate to the foreign key child column.
I have a form (WinForms app) for each of these tables with a datagrid
showing each table, which contains a user control, which is nothing more
than an add, update, delete record editor. I pass a currencymanager to the
user control such as: new uc(this.BindingContext[ds,"OrderDetails"]). I
have also experimented with passing the datarelation to the control such as:
this.BindingContext[ds,"Orders.OrdersOrderDetails"]). The problem with this
method is that when the changes are submitted to the database, my
currencymanager goes beserk and has the position set to -1, clearing the
grids and basically having everything go "blank".
I don't know what to do at this point. There seem to be only "easy"
examples of using a currencymanager that I have found. If someone could
tell me the proper way to set up a currencymanager when dealing with related
data, I would appreciate it. The grids appear on tabs of a tab control, if
that makes a difference.
Any suggestions would be appreciated!
Thanks,
Dave