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.
[quoted text, click to view] "Tom Woods" <twoods@gobaker.com> wrote in message
news:eEyyiyV%23HHA.5328@TK2MSFTNGP05.phx.gbl...
> 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
> DataSet's and MS SQL. I'll start by describing what my goals are:
>
> I have a form that will have a list (grid) of items from Orders. This
> list
> will be docked to the left side of my form. It will contain all orders of
> the day. I want to allow the user to create/view multiple orders using
> MDI.
> So when they click on an item in the
> list/grid, it will update the focused order form. If they create a new
> order, it will create a new Order from (child mdi). They could even be
> viewing multiple orders.
>
> From the standpoint of design. What is the best way to setup my DataSet?
> Should I have multiple - one for the list and one for each order form?
> Or,
> can just one be used?
>
> The listing of the orders is staight forward, however, how to manage two
> or
> more records being desplayed is a little more confusing.
>
> When it gets to TableAdapters, can you only have one? I thought about
> having the list/grid use one Fill method and the forms use another. Can
> this be done?
>
> I would like the fields on the MDI Child forms to be bound - if possible.
>
> As you can see, I'm a little lost. Can anyone shed a little light?
>
> TIA,
>
> Tom
>
>
>
>
>