Bind multiple DataTables as one object to a GridView

  • Thread starter Thread starter Joe Kovac
  • Start date Start date
J

Joe Kovac

Hi!

I have got a very complex database schema. For example a customer is
constructed within a Customer table and a Person table. I have both
tables as DataTables in a DataSet.
When I want to bind this data to a GridView I get offered both
DataTable-Adapters.
Now I believe that I should build something between the DataSet and the
GridView, but I don't know how it should look like.

One guess of mine is using a BindingList that contains custom objects.
The custom objects would just reference to the DataRow's properties in
the DataTables.

Is this a proper solution?
If yes, does someone have a sample for this way, where I can see how to
implement all the CRUD functionality?
If not, what would be a fast forward way to accomplish this task?

Thanks

Joe
 
the quickest solution would be to create a view from those tables, and then
bind it to controls
 
mirko said:
the quickest solution would be to create a view from those tables, and then
bind it to controls

Do you mean a view on the MSQL-Server?
Would such a view support updates, delete and create as well?
 
Joe said:
Do you mean a view on the MSQL-Server?
Would such a view support updates, delete and create as well?

Looks like this is no real option:
View or function 'Test.dbo.View_1' is not updatable because the
modification affects multiple base tables.
Or maybe I need some more info on views that can update multiple tables?
 
Back
Top