473,701 Members | 2,959 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Multiple Table DataSet

I want to list all of the items in a dataset in a textbox. The dataset
has multiple tables. When I try to use the code below, even though I
dim myState as the DataTable("stat e"). It still looks for othe rows in
the dataset.

Dim myState As DataTable = myDataSet.Table s("state")
Dim myTax As DataTable = myDataSet.Table s("Tax")
Dim row As DataRow
Dim column As DataColumn
For Each myState In myDataSet.Table s
For Each row In myState.Rows
For Each column In myState.Columns
txtList.Text += row("id").ToStr ing()
Next
Next
Next

A friend sent me some code that parses the DataSet and shows me the
structure of it. The first table is called "state" and the third table
is called "Tax".

Any help would be appreciated.

Scott Moore

Aug 21 '06 #1
7 2091
The reason for this is this line:

For Each myState In myDataSet.Table s

Even though your setting it to a specific table, this line sets it to
each table in the dataset starting with table(0).

When you say you want to list all the ITEMS do you mean data in the
columns or do you want to list the column names?

This is how you list the data in each column in a table.

Dim table As DataTable = dataset.tables( "Whatever")
Dim row As DataRow
Dim b As Byte

For Each row In table.Rows
For b = 0 To table.Columns.C ount - 1
TextBox1.Text = TextBox1.Text & row(b)
Next
Next
This is how you list each column name in the table.

Dim table As DataTable
Dim row As DataRow
Dim column As DataColumn

For Each row In table.Rows
For Each column In table.Columns
TextBox1.Text = TextBox1.Text & column.ColumnNa me
Next
Next

samoore33 wrote:
I want to list all of the items in a dataset in a textbox. The dataset
has multiple tables. When I try to use the code below, even though I
dim myState as the DataTable("stat e"). It still looks for othe rows in
the dataset.

Dim myState As DataTable = myDataSet.Table s("state")
Dim myTax As DataTable = myDataSet.Table s("Tax")
Dim row As DataRow
Dim column As DataColumn
For Each myState In myDataSet.Table s
For Each row In myState.Rows
For Each column In myState.Columns
txtList.Text += row("id").ToStr ing()
Next
Next
Next

A friend sent me some code that parses the DataSet and shows me the
structure of it. The first table is called "state" and the third table
is called "Tax".

Any help would be appreciated.

Scott Moore
Aug 21 '06 #2
Izzy,

You know that it is more expensive to take a byte as indexer.
The cheapest one one a 32bit system is the integer (int32).

(Your process to set it in the accumulator register takes more than that 3
bytes that you think to save).

Cor

"Izzy" <is************ @gmail.comschre ef in bericht
news:11******** **************@ i42g2000cwa.goo glegroups.com.. .
The reason for this is this line:

For Each myState In myDataSet.Table s

Even though your setting it to a specific table, this line sets it to
each table in the dataset starting with table(0).

When you say you want to list all the ITEMS do you mean data in the
columns or do you want to list the column names?

This is how you list the data in each column in a table.

Dim table As DataTable = dataset.tables( "Whatever")
Dim row As DataRow
Dim b As Byte

For Each row In table.Rows
For b = 0 To table.Columns.C ount - 1
TextBox1.Text = TextBox1.Text & row(b)
Next
Next
This is how you list each column name in the table.

Dim table As DataTable
Dim row As DataRow
Dim column As DataColumn

For Each row In table.Rows
For Each column In table.Columns
TextBox1.Text = TextBox1.Text & column.ColumnNa me
Next
Next

samoore33 wrote:
>I want to list all of the items in a dataset in a textbox. The dataset
has multiple tables. When I try to use the code below, even though I
dim myState as the DataTable("stat e"). It still looks for othe rows in
the dataset.

Dim myState As DataTable = myDataSet.Table s("state")
Dim myTax As DataTable = myDataSet.Table s("Tax")
Dim row As DataRow
Dim column As DataColumn
For Each myState In myDataSet.Table s
For Each row In myState.Rows
For Each column In myState.Columns
txtList.Text += row("id").ToStr ing()
Next
Next
Next

A friend sent me some code that parses the DataSet and shows me the
structure of it. The first table is called "state" and the third table
is called "Tax".

Any help would be appreciated.

Scott Moore

Aug 21 '06 #3
Scott,

Why not just use a datagrid

mydatagrid.data source = myDataset

Otherwise you have to loop through this set which all contains collections
dataset (has a collection of datatables with the name tables)
datatables (has a collecion of datarows with the name rows
datarows (has a collection of items which are the default)

All the collections have a count, while they all can be indexed by an
integer.

I hope this helps,

Cor

"samoore33" <sa*******@gmai l.comschreef in bericht
news:11******** **************@ m73g2000cwd.goo glegroups.com.. .
>I want to list all of the items in a dataset in a textbox. The dataset
has multiple tables. When I try to use the code below, even though I
dim myState as the DataTable("stat e"). It still looks for othe rows in
the dataset.

Dim myState As DataTable = myDataSet.Table s("state")
Dim myTax As DataTable = myDataSet.Table s("Tax")
Dim row As DataRow
Dim column As DataColumn
For Each myState In myDataSet.Table s
For Each row In myState.Rows
For Each column In myState.Columns
txtList.Text += row("id").ToStr ing()
Next
Next
Next

A friend sent me some code that parses the DataSet and shows me the
structure of it. The first table is called "state" and the third table
is called "Tax".

Any help would be appreciated.

Scott Moore

Aug 21 '06 #4
Didn't know that, thanks Cor.

I have some code to change.
Cor Ligthert [MVP] wrote:
Izzy,

You know that it is more expensive to take a byte as indexer.
The cheapest one one a 32bit system is the integer (int32).

(Your process to set it in the accumulator register takes more than that 3
bytes that you think to save).

Cor

"Izzy" <is************ @gmail.comschre ef in bericht
news:11******** **************@ i42g2000cwa.goo glegroups.com.. .
The reason for this is this line:

For Each myState In myDataSet.Table s

Even though your setting it to a specific table, this line sets it to
each table in the dataset starting with table(0).

When you say you want to list all the ITEMS do you mean data in the
columns or do you want to list the column names?

This is how you list the data in each column in a table.

Dim table As DataTable = dataset.tables( "Whatever")
Dim row As DataRow
Dim b As Byte

For Each row In table.Rows
For b = 0 To table.Columns.C ount - 1
TextBox1.Text = TextBox1.Text & row(b)
Next
Next
This is how you list each column name in the table.

Dim table As DataTable
Dim row As DataRow
Dim column As DataColumn

For Each row In table.Rows
For Each column In table.Columns
TextBox1.Text = TextBox1.Text & column.ColumnNa me
Next
Next

samoore33 wrote:
I want to list all of the items in a dataset in a textbox. The dataset
has multiple tables. When I try to use the code below, even though I
dim myState as the DataTable("stat e"). It still looks for othe rows in
the dataset.

Dim myState As DataTable = myDataSet.Table s("state")
Dim myTax As DataTable = myDataSet.Table s("Tax")
Dim row As DataRow
Dim column As DataColumn
For Each myState In myDataSet.Table s
For Each row In myState.Rows
For Each column In myState.Columns
txtList.Text += row("id").ToStr ing()
Next
Next
Next

A friend sent me some code that parses the DataSet and shows me the
structure of it. The first table is called "state" and the third table
is called "Tax".

Any help would be appreciated.

Scott Moore
Aug 21 '06 #5
Cor,

Believe me I would love to use a datagrid, I have a lot more experience
with datagrids. They want the information to populate a text box rather
then a datagrid.

Fun fun fun

Scott

Cor Ligthert [MVP] wrote:
Scott,

Why not just use a datagrid

mydatagrid.data source = myDataset

Otherwise you have to loop through this set which all contains collections
dataset (has a collection of datatables with the name tables)
datatables (has a collecion of datarows with the name rows
datarows (has a collection of items which are the default)

All the collections have a count, while they all can be indexed by an
integer.

I hope this helps,

Cor

"samoore33" <sa*******@gmai l.comschreef in bericht
news:11******** **************@ m73g2000cwd.goo glegroups.com.. .
I want to list all of the items in a dataset in a textbox. The dataset
has multiple tables. When I try to use the code below, even though I
dim myState as the DataTable("stat e"). It still looks for othe rows in
the dataset.

Dim myState As DataTable = myDataSet.Table s("state")
Dim myTax As DataTable = myDataSet.Table s("Tax")
Dim row As DataRow
Dim column As DataColumn
For Each myState In myDataSet.Table s
For Each row In myState.Rows
For Each column In myState.Columns
txtList.Text += row("id").ToStr ing()
Next
Next
Next

A friend sent me some code that parses the DataSet and shows me the
structure of it. The first table is called "state" and the third table
is called "Tax".

Any help would be appreciated.

Scott Moore
Aug 22 '06 #6
Scott,

And you know now how to do it?

Cor

"samoore33" <sa*******@gmai l.comschreef in bericht
news:11******** *************@m 79g2000cwm.goog legroups.com...
Cor,

Believe me I would love to use a datagrid, I have a lot more experience
with datagrids. They want the information to populate a text box rather
then a datagrid.

Fun fun fun

Scott

Cor Ligthert [MVP] wrote:
>Scott,

Why not just use a datagrid

mydatagrid.dat asource = myDataset

Otherwise you have to loop through this set which all contains
collections
dataset (has a collection of datatables with the name tables)
datatables (has a collecion of datarows with the name rows
datarows (has a collection of items which are the default)

All the collections have a count, while they all can be indexed by an
integer.

I hope this helps,

Cor

"samoore33" <sa*******@gmai l.comschreef in bericht
news:11******* *************** @m73g2000cwd.go oglegroups.com. ..
>I want to list all of the items in a dataset in a textbox. The dataset
has multiple tables. When I try to use the code below, even though I
dim myState as the DataTable("stat e"). It still looks for othe rows in
the dataset.

Dim myState As DataTable = myDataSet.Table s("state")
Dim myTax As DataTable = myDataSet.Table s("Tax")
Dim row As DataRow
Dim column As DataColumn
For Each myState In myDataSet.Table s
For Each row In myState.Rows
For Each column In myState.Columns
txtList.Text += row("id").ToStr ing()
Next
Next
Next

A friend sent me some code that parses the DataSet and shows me the
structure of it. The first table is called "state" and the third table
is called "Tax".

Any help would be appreciated.

Scott Moore

Aug 22 '06 #7
Cor,

Yes. I used what Izzy gave me to figure it out. I really do appreciate
the help from both Izzy and you.

Thanks a lot!

Scott

Cor Ligthert [MVP] wrote:
Scott,

And you know now how to do it?

Cor

"samoore33" <sa*******@gmai l.comschreef in bericht
news:11******** *************@m 79g2000cwm.goog legroups.com...
Cor,

Believe me I would love to use a datagrid, I have a lot more experience
with datagrids. They want the information to populate a text box rather
then a datagrid.

Fun fun fun

Scott

Cor Ligthert [MVP] wrote:
Scott,

Why not just use a datagrid

mydatagrid.data source = myDataset

Otherwise you have to loop through this set which all contains
collections
dataset (has a collection of datatables with the name tables)
datatables (has a collecion of datarows with the name rows
datarows (has a collection of items which are the default)

All the collections have a count, while they all can be indexed by an
integer.

I hope this helps,

Cor

"samoore33" <sa*******@gmai l.comschreef in bericht
news:11******** **************@ m73g2000cwd.goo glegroups.com.. .
I want to list all of the items in a dataset in a textbox. The dataset
has multiple tables. When I try to use the code below, even though I
dim myState as the DataTable("stat e"). It still looks for othe rows in
the dataset.

Dim myState As DataTable = myDataSet.Table s("state")
Dim myTax As DataTable = myDataSet.Table s("Tax")
Dim row As DataRow
Dim column As DataColumn
For Each myState In myDataSet.Table s
For Each row In myState.Rows
For Each column In myState.Columns
txtList.Text += row("id").ToStr ing()
Next
Next
Next

A friend sent me some code that parses the DataSet and shows me the
structure of it. The first table is called "state" and the third table
is called "Tax".

Any help would be appreciated.

Scott Moore
Aug 22 '06 #8

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

Similar topics

0
1630
by: | last post by:
Hi, I have an app that uses a typed dataset to persist user data. The dataset has a multiple tables with multiple table relations. The problem I am running into is that the user data is dynamic and is not predictable at design time. What I mean by this is the forms that user inputs data is not static - it changes dynamically at runtime based on user input. This makes it difficult to persist the data in a dataset with multiple...
3
16826
by: lee_mcknight | last post by:
I am using Crystal Enterprise V9. I have a report that needs to have multiple datasets as the datasource(s) on a single subreport (some common lookup data I need to join to is stored in a seperate dataset). The report is working fine with a single dataset as a datasource, but I cannot seem to find any examples of multiple datasets as a datasource. Is this possible? ReportDocument.SetDatasource() seems to only take a single dataset,...
0
1292
by: John Bailey | last post by:
I have a dataset with multiple data tables. I need to bind this to a wizard interface, where each portion of the wizard udates the information in one of the datatables. I am using formviews in each screen of the wizard since this seems to be the only way to databind anything in ASP.Net 2.0. I could not set the datasource to go against the dataset directly, since the methods to populate the dataset are in the dataadapter objects, and...
9
2769
by: Graham | last post by:
I have been having some fun learning and using the new Controls and methods in .Net 2.0 which will make my life in the future easier and faster. Specifically the new databinding practises and wizards. But, I have found that trying to do something "outside the norm" adds a rather large level of complexity and/or data replication. Background I have been commissioned to create a web-based application for a client. It has a formsaunthentication...
9
12981
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 northwind database that has an employees, orders, and order details. the following are the 3 tables in my sql database students schyrsem
4
3751
by: Dave Edwards | last post by:
I understand that I can fill a datagrid with multiple queries, but I cannot figure out how to fill a dataset with the same query but run against multiple SQL servers, the query , table structure and username, password etc will be exactly the same for each server, the only thing that will change is the server name. Idealy I would like to get the server names from a seperate dataset so there could be any number of servers, allthough in...
12
1762
by: Peter Proost | last post by:
Hi group, has anyone got any suggestions fot the best way to handle this problem, I've got 3 tables for example table A, B, and C table A looks like name, value table B looks like name, value table C looks like variablename, value, value an example would be
3
4474
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 another view on the same form. I've set up a parameterized tableadapter and pass it the city. How can I load the two views in VB code when the form loads? Thanks, Tom
7
15653
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 there an equivalent property for the DataGridView? I have searched, but have not found one. I would like the user to be able to see all the columns of the table on one screen - thus eliminating the need to use the horizontal scroll bar to view...
0
8649
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9232
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9084
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
7827
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6573
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5905
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4411
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4665
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3104
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

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.