I'd create a separate dataset for each form as well as for the list grid
form.
The list of orders might have a select statement like "SELECT OrderID,
OrderDate, ...<more fields to display> FROM ...
Each child form would have it's own dataset. The form constructor would
have OrderID passed as a parameter. In the form load event fill the the
order info dataset using the OrderID as parameter as in SELECT ... FROM
Order ... WHERE OrderID = @OrderID.
In the list grid form, I'd have it raise an event with the OrderID in the
event args. I'd have the MDI form listen for those events so that the MDI
form can open a child Order form.
After adding a new order, make sure you manually add the row to the grid
list, or, refresh the grid list from the database.
As an aside, I'd first work with the table adapters and related wizards
until I got to the point they destroyed the project. Then, I'd move back to
the VS 2003 approach using a component containing multiple data adapters.
Finally, I'd chuck the whole data adapter wizard, bite the bullet, and write
my own wizards either in MS Access or .NET to generate data adapter code.
> I've been struggling with the best way to use a DataSet, Bindings and
> Adapters in the application I'm laying out. To start, I'm new with
[quoted text clipped - 30 lines]
>
> Tom
Tom Woods - 18 Sep 2007 21:19 GMT
Thank you for your feedback!
I actually have created two small projects to determine the best way to
achive my goals. In one example, I'm using the BindingSource to tie the
list/grid and some actual bound fields on a form. However, I don't know how
to get the desiner to see the BindingSource from another form when trying to
add additional fields on a new form.
Are you familier with a way to have Form B see Form A's BindingSource?
Thanks,
Tom
> I'd create a separate dataset for each form as well as for the list grid
> form.
[quoted text clipped - 56 lines]
>>
>> Tom
Jim Rand - 19 Sep 2007 12:28 GMT
I've got a shared dataset for lookup tables. For example, assuming your
orders have order detail rows that reference inventory, the dataset
dsLookupTbls would contain an inventory table.
On the order form, you would drag a dsLookupTbls component onto the form
designer. Then you would drag a binding source onto the form designer.
During the form load, you would hot swap the datasource as in
bsInventory.DataSource = Helpers.LookupTblSingleton.Instance.dsLookupTbls;
Be careful of binding sources. There is a nasty bug that Microsoft has been
trying to fix for over a 1 1/2 years. See KB932491.
Jim
> Thank you for your feedback!
>
[quoted text clipped - 8 lines]
> Thanks,
> Tom
Tom Woods - 19 Sep 2007 13:43 GMT
Jim, thanks for the explaination...
I looked up KB932491 and it looks like it has been resolved. Take a look:
http://support.microsoft.com/kb/932491/en-us
Thanks again,
Tom
> I've got a shared dataset for lookup tables. For example, assuming your
> orders have order detail rows that reference inventory, the dataset
[quoted text clipped - 24 lines]
>> Thanks,
>> Tom