Bind multiple DataTables as one object to a GridView

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
 
M

mirko

the quickest solution would be to create a view from those tables, and then
bind it to controls
 
J

Joe Kovac

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?
 
J

Joe Kovac

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?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top