473,412 Members | 2,050 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,412 software developers and data experts.

Representing Related Data within a DataGrid

Hi,

It is possible to establish relationships between tables within a
dataset and this allows some useful features. For example, given a row
from a table you can use GetParentRow, GetParentRows, GetChildRows.

However, I don't see a good way to represent data from multiple dataset
tables within a single datagrid (although I can think of at least one
bad way). For example, if you have a Invoice table which instead of
having an company address, simply has a foreign key to an Address
table, but when the data is displayed in a grid, you want Invoice info
and the Address info to appear as 1 record. In the examples that I
have read, if data from multiple tables is required in this way, the
data is actually obtained by giving the SelectCommand a query that
includes the proper SQL statement with joins, etc. In this case, the
data from multiple tables is combined at the server and arrives within
the VB application as a single table. While this is useful, I would
like to see if it is possible to combine data from multiple dataset
tables.

Since the dataset approximately represents a database, what I imagine
for the solution would be some way to generate a new dataview that
would aggregate the data together based on a SQL-like statement that I
passed to a dataset method. This would also be different from writing
code that will generate a new combined table from scratch that if any
changes were made, the dataview would also be updated by changes in the
tables it was build from (I suppose you could also write code that
would update the generated table but would like to find a better way if
possible).

Also, I have noticed it is possible to set the datasource of a grid to
an entire dataset, but this does not produce the results I want.

Thank you,
Aaron

Aug 17 '06 #1
3 1686
Aaron,

It is possible, but don't expect to much from the result.

http://www.vb-tips.com/dbpages.aspx?...8-ddebf666ce1e

I hope this helps,

Cor

"Aaron" <od*********@hotmail.comschreef in bericht
news:11********************@i42g2000cwa.googlegrou ps.com...
Hi,

It is possible to establish relationships between tables within a
dataset and this allows some useful features. For example, given a row
from a table you can use GetParentRow, GetParentRows, GetChildRows.

However, I don't see a good way to represent data from multiple dataset
tables within a single datagrid (although I can think of at least one
bad way). For example, if you have a Invoice table which instead of
having an company address, simply has a foreign key to an Address
table, but when the data is displayed in a grid, you want Invoice info
and the Address info to appear as 1 record. In the examples that I
have read, if data from multiple tables is required in this way, the
data is actually obtained by giving the SelectCommand a query that
includes the proper SQL statement with joins, etc. In this case, the
data from multiple tables is combined at the server and arrives within
the VB application as a single table. While this is useful, I would
like to see if it is possible to combine data from multiple dataset
tables.

Since the dataset approximately represents a database, what I imagine
for the solution would be some way to generate a new dataview that
would aggregate the data together based on a SQL-like statement that I
passed to a dataset method. This would also be different from writing
code that will generate a new combined table from scratch that if any
changes were made, the dataview would also be updated by changes in the
tables it was build from (I suppose you could also write code that
would update the generated table but would like to find a better way if
possible).

Also, I have noticed it is possible to set the datasource of a grid to
an entire dataset, but this does not produce the results I want.

Thank you,
Aaron

Aug 17 '06 #2
Cor,

Thank you for responding. While setting a grid's datasource to a
dataset WILL allow a user to navigate the tables based on the
relationships, it does not have the capability that I was looking for.
Rather than showing the foreign key and clicking on a link to the
related data, I would like if the fk were not even shown to the user
the related data would appear in the same line of the grid.

I guess what I am looking for would be analogous to a SQL server View,
but instead of being created on the server, it would be created
entirely within the VB application with tables from a dataset.

Aaron

Aug 17 '06 #3
Aaron,

The same as an advice I gave to somebody else yesterday, just use two grid
above each other, it is easier for you and your enduser. I did look as well
for what you are looking for, I never saw it.

If you need a link to our website where there are samples for that reply.

I hope this helps,

Cor
"Aaron" <od*********@hotmail.comschreef in bericht
news:11**********************@i3g2000cwc.googlegro ups.com...
Cor,

Thank you for responding. While setting a grid's datasource to a
dataset WILL allow a user to navigate the tables based on the
relationships, it does not have the capability that I was looking for.
Rather than showing the foreign key and clicking on a link to the
related data, I would like if the fk were not even shown to the user
the related data would appear in the same line of the grid.

I guess what I am looking for would be analogous to a SQL server View,
but instead of being created on the server, it would be created
entirely within the VB application with tables from a dataset.

Aaron

Aug 17 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Pet Matrix. | last post by:
Hi, I am having the schema and one element in that schema is , <xs:element name="EndT" type="TstampType" minOccurs="1" maxOccurs="1"/> How do I represent the NULL value for the datatype dateTime...
4
by: Patrick | last post by:
I have a Windows Forms DataGrid bound to a Table within a DataSet. The Table is related to others within the DataSet. The DataGrid allows the user to surf through related tables. I don't want...
2
by: Jason (Kusanagihk) | last post by:
To all, I am writing a C# application; I've a DataGrid to show and edit data; then I tried to update the updated data by calling ADO_Adapter.update (ADO_DataSet, "TableName"); But it pop up a...
1
by: Craig Banks | last post by:
If a row of data in a dataset has a lot of columns the row displaying the data in a datagrid will run way off the screen. What I'd like to do is display a row of data over several datagrid rows so...
2
by: Jim in Arizona | last post by:
Usually, If i need special formatting, I don't use the datagrid control and use a loop that processes a table for each record read from the database (as in classic asp) like so: ...
4
by: hope | last post by:
Hi, How can I format a string field using Data Formatting Expression property in datagrid? For example: format last name from BROWN to Brown. Thanks
1
by: Greg | last post by:
Hi, I need to implement a table in XBRL. Let's assume I have 2 simple tables to define: TABLE 1 col1 col2 row1 A C row2 B D TABLE 2
5
by: Antonio | last post by:
Hello, everyone. Is there a way to not display a certain value in a datagrid cell? I have a datagrid for subscriptions and ebooks and if there isn't an e-book listed, the value from the...
0
by: =?Utf-8?B?VGVjaGVlaw==?= | last post by:
I am building one application is VB.NET. I am using a grid, but facing some problems related to it. 1) I am using .Net 1.1. I have used a datagrid.I have added a template column in the...
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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
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...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

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.