473,394 Members | 1,699 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

Multiple tables in my dataview

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
8 10347
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
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
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
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
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
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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Michael Vanhoutte | last post by:
I was wondering how multiple threads can access the ASP.NET cache object safely. Take for example the following code that I got from the ASP.NET Cache object documentation: DataView Source =...
3
by: crjunk | last post by:
I have 4 different databases that I'm having to pull data from in order to populate a datagrid. I am able to do this, but my problem is that because I'm pulling the data from 4 different...
9
by: jaYPee | last post by:
I have search a lot of thread in google newsgroup and read a lot of articles but still i don't know how to update the dataset that has 3 tables. my 3 tables looks like the 3 tables from...
5
by: Robert Brown | last post by:
Hi All. I have a routine that checks a SQL Table for all records 3 months prior to a predetermined date, then I insert them into an Archive DB then delete those records from the original table....
5
by: Ron L | last post by:
I have a DataTable that is being maintained in a Model class. I also have a View class which creates a DataView from the DataTable that the Model passes it. The view class then has methods to...
3
by: TomH | last post by:
I am using VB within VS 2005. How can I have multiple datagridviews on the same form pulling from the same table? e.g. I want to see all clients from New York in one view and all clients from LA in...
3
by: =?Utf-8?B?bWljaGFlbCBzb3JlbnM=?= | last post by:
I am wondering if someone could provide a code sample (or just a suggested approach) on how to fill a single DataGridView with multiple result sets. For example, this statement returns a one-line...
7
by: =?Utf-8?B?TG9zdEluTUQ=?= | last post by:
Hi All :) I'm converting VB6 using True DBGrid Pro 8.0 to VB2005 using DataGridView. True DBGrid has a MultipleLines property that controls whether individual records span multiple lines. Is...
1
by: Hetal | last post by:
Hi... We are on Visual Basic .NET 2003 and i am using DataView to sort the DataTable. However, we are facing problems with sorting the data based on multiple columns. The below statement to...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.