By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,952 Members | 1,908 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,952 IT Pros & Developers. It's quick & easy.

Multiple tables in my dataview

P: n/a
Hi all,

does anyone know if I can create a dataview
from multiple datatables. My dataset is constructed
from four separate tables and then the relationships
are added that link the tables together. To make
data entry easier I would like to combine selected
columns from the four tables onto a single dataview that
could be used as the datasource for a datagrid
control. The distinct updates, insert ans delete
commands would then be used to update the datatables
in the dataset and write the changes back to the
database.

If this is not the way the problem I have should be
answered then please feel free to offer any alternatives.

Many thanks,

Jason.
Nov 20 '05 #1
Share this Question
Share on Google+
8 Replies


P: n/a
http://msdn.microsoft.com/library/de...iewmanager.asp

--

OHM ( Terry Burns )
. . . One-Handed-Man . . .

Time flies when you don't know what you're doing

"Jason L James" <ja***@no-spam.dive-master.org> wrote in message
news:40**************@news.demon.co.uk...
Hi all,

does anyone know if I can create a dataview
from multiple datatables. My dataset is constructed
from four separate tables and then the relationships
are added that link the tables together. To make
data entry easier I would like to combine selected
columns from the four tables onto a single dataview that
could be used as the datasource for a datagrid
control. The distinct updates, insert ans delete
commands would then be used to update the datatables
in the dataset and write the changes back to the
database.

If this is not the way the problem I have should be
answered then please feel free to offer any alternatives.

Many thanks,

Jason.

Nov 20 '05 #2

P: n/a
Thanks for the info. However, I would like to be able
to view all fields contained in the multiple table
relationship on the same line of my datagrid,
as though I had performed a select query with
mutliple joins in it. The porblem with using a
select query with data from multiple tables is that
I can not then use the dataadapter.update
command to pass the information back to the
database.

Any more ideas, or reasons why this might not
be possible?

Thanks,

Jason.

On Wed, 7 Jul 2004 11:42:53 +0100, "One Handed Man \( OHM - Terry
Burns \)" <news.microsoft.com> wrote:
http://msdn.microsoft.com/library/de...iewmanager.asp

--

OHM ( Terry Burns )
. . . One-Handed-Man . . .

Time flies when you don't know what you're doing

"Jason L James" <ja***@no-spam.dive-master.org> wrote in message
news:40**************@news.demon.co.uk...
Hi all,

does anyone know if I can create a dataview
from multiple datatables. My dataset is constructed
from four separate tables and then the relationships
are added that link the tables together. To make
data entry easier I would like to combine selected
columns from the four tables onto a single dataview that
could be used as the datasource for a datagrid
control. The distinct updates, insert ans delete
commands would then be used to update the datatables
in the dataset and write the changes back to the
database.

If this is not the way the problem I have should be
answered then please feel free to offer any alternatives.

Many thanks,

Jason.



Nov 20 '05 #3

P: n/a
Whats wrong with using the update function on each adapter ? just call 4
adapters in turn, alternatively, you could manually do this in code.

--

OHM ( Terry Burns )
. . . One-Handed-Man . . .

Time flies when you don't know what you're doing

"Jason L James" <ja***@no-spam.dive-master.org> wrote in message
news:40**************@news.demon.co.uk...
Thanks for the info. However, I would like to be able
to view all fields contained in the multiple table
relationship on the same line of my datagrid,
as though I had performed a select query with
mutliple joins in it. The porblem with using a
select query with data from multiple tables is that
I can not then use the dataadapter.update
command to pass the information back to the
database.

Any more ideas, or reasons why this might not
be possible?

Thanks,

Jason.

On Wed, 7 Jul 2004 11:42:53 +0100, "One Handed Man \( OHM - Terry
Burns \)" <news.microsoft.com> wrote:
http://msdn.microsoft.com/library/de...-us/cpguide/ht

ml/cpconsettingdefaulttableviewsusingdataviewmanager. asp

--

OHM ( Terry Burns )
. . . One-Handed-Man . . .

Time flies when you don't know what you're doing

"Jason L James" <ja***@no-spam.dive-master.org> wrote in message
news:40**************@news.demon.co.uk...
Hi all,

does anyone know if I can create a dataview
from multiple datatables. My dataset is constructed
from four separate tables and then the relationships
are added that link the tables together. To make
data entry easier I would like to combine selected
columns from the four tables onto a single dataview that
could be used as the datasource for a datagrid
control. The distinct updates, insert ans delete
commands would then be used to update the datatables
in the dataset and write the changes back to the
database.

If this is not the way the problem I have should be
answered then please feel free to offer any alternatives.

Many thanks,

Jason.


Nov 20 '05 #4

P: n/a
Using the four DAs is no problem with a dataset with
related tables. This however spreads the information
over the four tables and so the user can not see the
information from all four tables at the same time on the
data grid. They have to traverse the realtionships to
get the the related data. I would prefer all of the data
from the four tables an the screen, and editable in
a datagrid a the same time is at all possible.

Thanks for persevering.

Jason.

On Wed, 7 Jul 2004 13:22:14 +0100, "One Handed Man \( OHM - Terry
Burns \)" <news.microsoft.com> wrote:
Whats wrong with using the update function on each adapter ? just call 4
adapters in turn, alternatively, you could manually do this in code.

--

OHM ( Terry Burns )
. . . One-Handed-Man . . .

Time flies when you don't know what you're doing

"Jason L James" <ja***@no-spam.dive-master.org> wrote in message
news:40**************@news.demon.co.uk...
Thanks for the info. However, I would like to be able
to view all fields contained in the multiple table
relationship on the same line of my datagrid,
as though I had performed a select query with
mutliple joins in it. The porblem with using a
select query with data from multiple tables is that
I can not then use the dataadapter.update
command to pass the information back to the
database.

Any more ideas, or reasons why this might not
be possible?

Thanks,

Jason.

On Wed, 7 Jul 2004 11:42:53 +0100, "One Handed Man \( OHM - Terry
Burns \)" <news.microsoft.com> wrote:
http://msdn.microsoft.com/library/de...-us/cpguide/ht

ml/cpconsettingdefaulttableviewsusingdataviewmanager. asp
>
>--
>
>OHM ( Terry Burns )
> . . . One-Handed-Man . . .
>
>Time flies when you don't know what you're doing
>
>"Jason L James" <ja***@no-spam.dive-master.org> wrote in message
>news:40**************@news.demon.co.uk...
>> Hi all,
>>
>> does anyone know if I can create a dataview
>> from multiple datatables. My dataset is constructed
>> from four separate tables and then the relationships
>> are added that link the tables together. To make
>> data entry easier I would like to combine selected
>> columns from the four tables onto a single dataview that
>> could be used as the datasource for a datagrid
>> control. The distinct updates, insert ans delete
>> commands would then be used to update the datatables
>> in the dataset and write the changes back to the
>> database.
>>
>> If this is not the way the problem I have should be
>> answered then please feel free to offer any alternatives.
>>
>> Many thanks,
>>
>> Jason.
>
>



Nov 20 '05 #5

P: n/a
You might want to try and see if a third party grid will do this, I
understand there are a few of them on the market, perhaps one will do what
you need.

Other than than you may be forced to conjuring up some sort of middleware
object that handles all this, perhaps a custom control even, a lot of work
me thinks.

I'm sure your not the first one to ask for this, but I must say, your the
first that I remember, perhaps another solution is to re-think the design
based on what the objects will currently do ?

--

OHM ( Terry Burns )
. . . One-Handed-Man . . .

Time flies when you don't know what you're doing

"Jason L James" <ja***@no-spam.dive-master.org> wrote in message
news:40***************@news.demon.co.uk...
Using the four DAs is no problem with a dataset with
related tables. This however spreads the information
over the four tables and so the user can not see the
information from all four tables at the same time on the
data grid. They have to traverse the realtionships to
get the the related data. I would prefer all of the data
from the four tables an the screen, and editable in
a datagrid a the same time is at all possible.

Thanks for persevering.

Jason.

On Wed, 7 Jul 2004 13:22:14 +0100, "One Handed Man \( OHM - Terry
Burns \)" <news.microsoft.com> wrote:
Whats wrong with using the update function on each adapter ? just call 4
adapters in turn, alternatively, you could manually do this in code.

--

OHM ( Terry Burns )
. . . One-Handed-Man . . .

Time flies when you don't know what you're doing

"Jason L James" <ja***@no-spam.dive-master.org> wrote in message
news:40**************@news.demon.co.uk...
Thanks for the info. However, I would like to be able
to view all fields contained in the multiple table
relationship on the same line of my datagrid,
as though I had performed a select query with
mutliple joins in it. The porblem with using a
select query with data from multiple tables is that
I can not then use the dataadapter.update
command to pass the information back to the
database.

Any more ideas, or reasons why this might not
be possible?

Thanks,

Jason.

On Wed, 7 Jul 2004 11:42:53 +0100, "One Handed Man \( OHM - Terry
Burns \)" <news.microsoft.com> wrote:

http://msdn.microsoft.com/library/de...n-us/cpguide/h

tml/cpconsettingdefaulttableviewsusingdataviewmanager. asp
>
>--
>
>OHM ( Terry Burns )
> . . . One-Handed-Man . . .
>
>Time flies when you don't know what you're doing
>
>"Jason L James" <ja***@no-spam.dive-master.org> wrote in message
>news:40**************@news.demon.co.uk...
>> Hi all,
>>
>> does anyone know if I can create a dataview
>> from multiple datatables. My dataset is constructed
>> from four separate tables and then the relationships
>> are added that link the tables together. To make
>> data entry easier I would like to combine selected
>> columns from the four tables onto a single dataview that
>> could be used as the datasource for a datagrid
>> control. The distinct updates, insert ans delete
>> commands would then be used to update the datatables
>> in the dataset and write the changes back to the
>> database.
>>
>> If this is not the way the problem I have should be
>> answered then please feel free to offer any alternatives.
>>
>> Many thanks,
>>
>> Jason.
>
>


Nov 20 '05 #6

P: n/a
Many thanks for your help.

Jason.

On Wed, 7 Jul 2004 14:37:11 +0100, "One Handed Man \( OHM - Terry
Burns \)" <news.microsoft.com> wrote:
You might want to try and see if a third party grid will do this, I
understand there are a few of them on the market, perhaps one will do what
you need.

Other than than you may be forced to conjuring up some sort of middleware
object that handles all this, perhaps a custom control even, a lot of work
me thinks.

I'm sure your not the first one to ask for this, but I must say, your the
first that I remember, perhaps another solution is to re-think the design
based on what the objects will currently do ?

--

OHM ( Terry Burns )
. . . One-Handed-Man . . .

Time flies when you don't know what you're doing

"Jason L James" <ja***@no-spam.dive-master.org> wrote in message
news:40***************@news.demon.co.uk...
Using the four DAs is no problem with a dataset with
related tables. This however spreads the information
over the four tables and so the user can not see the
information from all four tables at the same time on the
data grid. They have to traverse the realtionships to
get the the related data. I would prefer all of the data
from the four tables an the screen, and editable in
a datagrid a the same time is at all possible.

Thanks for persevering.

Jason.

On Wed, 7 Jul 2004 13:22:14 +0100, "One Handed Man \( OHM - Terry
Burns \)" <news.microsoft.com> wrote:
>Whats wrong with using the update function on each adapter ? just call 4
>adapters in turn, alternatively, you could manually do this in code.
>
>--
>
>OHM ( Terry Burns )
> . . . One-Handed-Man . . .
>
>Time flies when you don't know what you're doing
>
>"Jason L James" <ja***@no-spam.dive-master.org> wrote in message
>news:40**************@news.demon.co.uk...
>> Thanks for the info. However, I would like to be able
>> to view all fields contained in the multiple table
>> relationship on the same line of my datagrid,
>> as though I had performed a select query with
>> mutliple joins in it. The porblem with using a
>> select query with data from multiple tables is that
>> I can not then use the dataadapter.update
>> command to pass the information back to the
>> database.
>>
>> Any more ideas, or reasons why this might not
>> be possible?
>>
>> Thanks,
>>
>> Jason.
>>
>> On Wed, 7 Jul 2004 11:42:53 +0100, "One Handed Man \( OHM - Terry
>> Burns \)" <news.microsoft.com> wrote:
>>
>>

http://msdn.microsoft.com/library/de...n-us/cpguide/ht >ml/cpconsettingdefaulttableviewsusingdataviewmanager. asp
>> >
>> >--
>> >
>> >OHM ( Terry Burns )
>> > . . . One-Handed-Man . . .
>> >
>> >Time flies when you don't know what you're doing
>> >
>> >"Jason L James" <ja***@no-spam.dive-master.org> wrote in message
>> >news:40**************@news.demon.co.uk...
>> >> Hi all,
>> >>
>> >> does anyone know if I can create a dataview
>> >> from multiple datatables. My dataset is constructed
>> >> from four separate tables and then the relationships
>> >> are added that link the tables together. To make
>> >> data entry easier I would like to combine selected
>> >> columns from the four tables onto a single dataview that
>> >> could be used as the datasource for a datagrid
>> >> control. The distinct updates, insert ans delete
>> >> commands would then be used to update the datatables
>> >> in the dataset and write the changes back to the
>> >> database.
>> >>
>> >> If this is not the way the problem I have should be
>> >> answered then please feel free to offer any alternatives.
>> >>
>> >> Many thanks,
>> >>
>> >> Jason.
>> >
>> >
>>
>
>



Nov 20 '05 #7

P: n/a
OK, good luck and I would be interested in knowing what solution you came up
with in the end as someone, perhaps me even, will ask this again.

--

OHM ( Terry Burns )
. . . One-Handed-Man . . .

Time flies when you don't know what you're doing

"Jason L James" <ja***@no-spam.dive-master.org> wrote in message
news:40***************@news.demon.co.uk...
Many thanks for your help.

Jason.

On Wed, 7 Jul 2004 14:37:11 +0100, "One Handed Man \( OHM - Terry
Burns \)" <news.microsoft.com> wrote:
You might want to try and see if a third party grid will do this, I
understand there are a few of them on the market, perhaps one will do what
you need.

Other than than you may be forced to conjuring up some sort of middleware
object that handles all this, perhaps a custom control even, a lot of workme thinks.

I'm sure your not the first one to ask for this, but I must say, your the
first that I remember, perhaps another solution is to re-think the design
based on what the objects will currently do ?

--

OHM ( Terry Burns )
. . . One-Handed-Man . . .

Time flies when you don't know what you're doing

"Jason L James" <ja***@no-spam.dive-master.org> wrote in message
news:40***************@news.demon.co.uk...
Using the four DAs is no problem with a dataset with
related tables. This however spreads the information
over the four tables and so the user can not see the
information from all four tables at the same time on the
data grid. They have to traverse the realtionships to
get the the related data. I would prefer all of the data
from the four tables an the screen, and editable in
a datagrid a the same time is at all possible.

Thanks for persevering.

Jason.

On Wed, 7 Jul 2004 13:22:14 +0100, "One Handed Man \( OHM - Terry
Burns \)" <news.microsoft.com> wrote:

>Whats wrong with using the update function on each adapter ? just call 4 >adapters in turn, alternatively, you could manually do this in code.
>
>--
>
>OHM ( Terry Burns )
> . . . One-Handed-Man . . .
>
>Time flies when you don't know what you're doing
>
>"Jason L James" <ja***@no-spam.dive-master.org> wrote in message
>news:40**************@news.demon.co.uk...
>> Thanks for the info. However, I would like to be able
>> to view all fields contained in the multiple table
>> relationship on the same line of my datagrid,
>> as though I had performed a select query with
>> mutliple joins in it. The porblem with using a
>> select query with data from multiple tables is that
>> I can not then use the dataadapter.update
>> command to pass the information back to the
>> database.
>>
>> Any more ideas, or reasons why this might not
>> be possible?
>>
>> Thanks,
>>
>> Jason.
>>
>> On Wed, 7 Jul 2004 11:42:53 +0100, "One Handed Man \( OHM - Terry
>> Burns \)" <news.microsoft.com> wrote:
>>
>>
http://msdn.microsoft.com/library/de...en-us/cpguide/

ht
>ml/cpconsettingdefaulttableviewsusingdataviewmanager. asp
>> >
>> >--
>> >
>> >OHM ( Terry Burns )
>> > . . . One-Handed-Man . . .
>> >
>> >Time flies when you don't know what you're doing
>> >
>> >"Jason L James" <ja***@no-spam.dive-master.org> wrote in message
>> >news:40**************@news.demon.co.uk...
>> >> Hi all,
>> >>
>> >> does anyone know if I can create a dataview
>> >> from multiple datatables. My dataset is constructed
>> >> from four separate tables and then the relationships
>> >> are added that link the tables together. To make
>> >> data entry easier I would like to combine selected
>> >> columns from the four tables onto a single dataview that
>> >> could be used as the datasource for a datagrid
>> >> control. The distinct updates, insert ans delete
>> >> commands would then be used to update the datatables
>> >> in the dataset and write the changes back to the
>> >> database.
>> >>
>> >> If this is not the way the problem I have should be
>> >> answered then please feel free to offer any alternatives.
>> >>
>> >> Many thanks,
>> >>
>> >> Jason.
>> >
>> >
>>
>
>


Nov 20 '05 #8

P: n/a
Jason,
In addition to the other comments.

The only ways I can think of is to denormalize the data, use 4 grids, or
possibly a JoinView...

I would favor the 4 grids...

You could denormalize the data into a single table, The caveat being updated
components...

The following sample using 3 grids is taken for a Northwind Sample:

customerAdapter.Fill(customerDataSet, "Customers")
orderAdapter.Fill(customerDataSet, "Orders")
orderDetailsAdapter.Fill(customerDataSet, "OrderDetails")

' Create relationships.
customerDataSet.Relations.Add("CustomerOrders", _
customerDataSet.Tables("Customers").Columns("Custo merID"), _
customerDataSet.Tables("Orders").Columns("Customer ID"))

customerDataSet.Relations.Add("OrderDetails", _
customerDataSet.Tables("Orders").Columns("OrderID" ), _
customerDataSet.Tables("OrderDetails").Columns("Or derID"))

' Bind to a DataGrid.
Me.DataGrid1.SetDataBinding(customerDataSet, "Customers")
Me.DataGrid2.SetDataBinding(customerDataSet,
"Customers.CustomerOrders")
Me.DataGrid3.SetDataBinding(customerDataSet,
"Customers.CustomerOrders.OrderDetails")
There is a JoinView sample custom DaveView class for VB.NET that you might
be able to modify to do what you want...

See:
http://support.microsoft.com/default...en-us%3B325682

Basically you create a new JoinView object, set the properties for your
join, then use this JoinView object as the DataSource on your DataGrid.

Hope this helps
Jay
"Jason L James" <ja***@no-spam.dive-master.org> wrote in message
news:40**************@news.demon.co.uk...
Hi all,

does anyone know if I can create a dataview
from multiple datatables. My dataset is constructed
from four separate tables and then the relationships
are added that link the tables together. To make
data entry easier I would like to combine selected
columns from the four tables onto a single dataview that
could be used as the datasource for a datagrid
control. The distinct updates, insert ans delete
commands would then be used to update the datatables
in the dataset and write the changes back to the
database.

If this is not the way the problem I have should be
answered then please feel free to offer any alternatives.

Many thanks,

Jason.

Nov 20 '05 #9

This discussion thread is closed

Replies have been disabled for this discussion.