Using queries in a table adaptor?

G

Guest

I have a data set called “ProductDataSet.xsd†that include several tables one
called [Drive Packages] with 14 columns and several rows of data. The table
adaptor attached to this is a table adapter called “Drive Package
TableAdapterâ€. To this table adapter I have added several queries:

One called list Data
SELECT [Drive Package ID], [Drive Nomenclature] AS Drive,
[HP Max] AS HP, [RPM Max] AS [Max RPM],
[RPM Min] AS [Min RPM]
FROM [Drive Package]
WHERE ([Product Line ID] = ProductLineID) AND ([Unit Size] = UnitSize)
ORDER BY [Drive Nomenclature]
The two procedures are called FillListData and GetByListdata
When I excite the following statement
DataTable ListData =
this.drive_PackageTableAdapter.GetListData(ProductLineID, UnitSize);
The columns I have aliased above are now where to be seen. For this quarry
I did not need them explicitly because I bound them to a C1 flex grid.
Although, I did have to make five columns in the right order and names. Note
I the correct amount of rows for the where clause.

The second one Max Mins
SELECT MAX([HP Max]) AS MaxHPMax, MIN([RPM Min]) AS MinRPMMin,
MAX([RPM Max]) AS MaxRPMMax
FROM [Drive Package]
WHERE (([Product Line ID] = ProductLineID) AND ([Unit Size] =
UnitSize));
The two procedures are called FillMaxMins and GetMaxMins.
Again exciting
DataTable dataMaxMins = this.drive_PackageTableAdapter.GetMaxMins(2, "086");
The aliases are no where to be seen. This one returns only one record and
it did. So I tried:
object[] MaxMins = new object[3];
MaxMins = this.drive_PackageTableAdapter.GetMaxMins(2,
"086").Rows[0].ItemArray;
And I can see the data I want but it is tacken on the end of an array of 14
items. One for each column in the orignal table and the there ones above.

The question is how do I get the coliums in the quary and only the colums in
the quary? These are not complacte quaries and if I can not use the dataset
for these what good is it.
 
K

Kevin Yu [MSFT]

Hi Mike,

I'm not quite sure about your question. Let me clarify something:

The TableAdapter is designed for returning one table only from the SELECT
statement. Are you trying to return multiple result sets from the two
statements or join the two result sets together? If you need to join them,
you have to use JOIN statement in the SELECT statement.

Kevin Yu
Microsoft Online Community Support

==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
ications.
Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscriptions/support/default.aspx.
==================================================

(This posting is provided "AS IS", with no warranties, and confers no
rights.)
 
C

Cor Ligthert [MVP]

Michael,

Did you try your problem with a Microsoft DataGridView, in that you can do
in a simple way almost endless presentation editing with a datatable.

The table adapter will always retrieve those rows in a table as is set in
the SelectCommand property of that.

Be aware that an adapter.fill does not replace rows, but just add those.

Cor
 
G

Guest

Let me explain father:
The first I had add a table adaptor to an existing dataset call
productDataSet.xsd (using the graphical editor). This adaptor looks at a
table in an Access database connected to the dataset. When added a query was
added that filled the complete table. The dataset, table-adaptor, and
associated binding-source are placed on a form (a MDI form, this should not
make any difference); the table is filled when the form is loaded.
I then added the two queries shown in the original message. The first query
returns a 5 column table with anywhere from between 0 and 5 rows; each column
has an aliases to provide column headers. The second query returns 3 derived
columns with an aliases and returns one row. These both only return one
table and are simple queries on a simple table.
The question is:
How do i use the columns and aliases in the queries and only those columns?
What seems to be returned is the complete underlying table columns and the
rows requested.
I assumed that the dataset is a typed data set, so I should be able to see
the columns in the IntelliSense list in the code editor, which I do not. In
addition, they are not to be found in the Autos or Local windows when a set a
brake point after executing the code shown in the original message.
On the first query, I have worked it out so I can use it with the flex grid
form ComponentOne. I am use the flex grid because of some unique features I
wanted.
The real problem is the second query:
I want the max and min to use in code. It looks like the only way I can use
them is assuming the number of columns in the original table and taking the
next three in a generic ItemArray. This is very poor programming techniques
and tightly couples the database to the program, which I do not want.
Does this clarify what I want?
Thank you for your help.

--
Mike Reed


Michael D. Reed said:
I have a data set called “ProductDataSet.xsd†that include several tables one
called [Drive Packages] with 14 columns and several rows of data. The table
adaptor attached to this is a table adapter called “Drive Package
TableAdapterâ€. To this table adapter I have added several queries:

One called list Data
SELECT [Drive Package ID], [Drive Nomenclature] AS Drive,
[HP Max] AS HP, [RPM Max] AS [Max RPM],
[RPM Min] AS [Min RPM]
FROM [Drive Package]
WHERE ([Product Line ID] = ProductLineID) AND ([Unit Size] = UnitSize)
ORDER BY [Drive Nomenclature]
The two procedures are called FillListData and GetByListdata
When I excite the following statement
DataTable ListData =
this.drive_PackageTableAdapter.GetListData(ProductLineID, UnitSize);
The columns I have aliased above are now where to be seen. For this quarry
I did not need them explicitly because I bound them to a C1 flex grid.
Although, I did have to make five columns in the right order and names. Note
I the correct amount of rows for the where clause.

The second one Max Mins
SELECT MAX([HP Max]) AS MaxHPMax, MIN([RPM Min]) AS MinRPMMin,
MAX([RPM Max]) AS MaxRPMMax
FROM [Drive Package]
WHERE (([Product Line ID] = ProductLineID) AND ([Unit Size] =
UnitSize));
The two procedures are called FillMaxMins and GetMaxMins.
Again exciting
DataTable dataMaxMins = this.drive_PackageTableAdapter.GetMaxMins(2, "086");
The aliases are no where to be seen. This one returns only one record and
it did. So I tried:
object[] MaxMins = new object[3];
MaxMins = this.drive_PackageTableAdapter.GetMaxMins(2,
"086").Rows[0].ItemArray;
And I can see the data I want but it is tacken on the end of an array of 14
items. One for each column in the orignal table and the there ones above.

The question is how do I get the coliums in the quary and only the colums in
the quary? These are not complacte quaries and if I can not use the dataset
for these what good is it.
 
G

Guest

Please see post to the original message.
--
Mike Reed


Cor Ligthert said:
Michael,

Did you try your problem with a Microsoft DataGridView, in that you can do
in a simple way almost endless presentation editing with a datatable.

The table adapter will always retrieve those rows in a table as is set in
the SelectCommand property of that.

Be aware that an adapter.fill does not replace rows, but just add those.

Cor

Michael D. Reed said:
I have a data set called "ProductDataSet.xsd" that include several tables
one
called [Drive Packages] with 14 columns and several rows of data. The
table
adaptor attached to this is a table adapter called "Drive Package
TableAdapter". To this table adapter I have added several queries:

One called list Data
SELECT [Drive Package ID], [Drive Nomenclature] AS Drive,
[HP Max] AS HP, [RPM Max] AS [Max RPM],
[RPM Min] AS [Min RPM]
FROM [Drive Package]
WHERE ([Product Line ID] = ProductLineID) AND ([Unit Size] =
UnitSize)
ORDER BY [Drive Nomenclature]
The two procedures are called FillListData and GetByListdata
When I excite the following statement
DataTable ListData =
this.drive_PackageTableAdapter.GetListData(ProductLineID, UnitSize);
The columns I have aliased above are now where to be seen. For this
quarry
I did not need them explicitly because I bound them to a C1 flex grid.
Although, I did have to make five columns in the right order and names.
Note
I the correct amount of rows for the where clause.

The second one Max Mins
SELECT MAX([HP Max]) AS MaxHPMax, MIN([RPM Min]) AS MinRPMMin,
MAX([RPM Max]) AS MaxRPMMax
FROM [Drive Package]
WHERE (([Product Line ID] = ProductLineID) AND ([Unit Size] =
UnitSize));
The two procedures are called FillMaxMins and GetMaxMins.
Again exciting
DataTable dataMaxMins = this.drive_PackageTableAdapter.GetMaxMins(2,
"086");
The aliases are no where to be seen. This one returns only one record and
it did. So I tried:
object[] MaxMins = new object[3];
MaxMins = this.drive_PackageTableAdapter.GetMaxMins(2,
"086").Rows[0].ItemArray;
And I can see the data I want but it is tacken on the end of an array of
14
items. One for each column in the orignal table and the there ones above.

The question is how do I get the coliums in the quary and only the colums
in
the quary? These are not complacte quaries and if I can not use the
dataset
for these what good is it.
 
C

Cor Ligthert [MVP]

Michael,

Do you mean that you want selective use some columns from a datatable.

Your text is so long and contains so many elements which I can not place in
connection with the problem that it confuses at least me.

If the first sentence is your question than the answer can be this.

Dataview.totable(overloaded)
http://msdn2.microsoft.com/en-us/library/h2b6ehaa.aspx

Be aware that the result is than not a typed dataset from format 1.x or 2.0
because those are closed classes that assume that you do your column
selections for grids using the complex data controls. This is in fact a very
strange to use method and as often said by others in this newsgroup "a not
needed possibility".

If you want to do it with your flexgrid, why than not contact ComponentOne?

Cor




Michael D. Reed said:
Let me explain father:
The first I had add a table adaptor to an existing dataset call
productDataSet.xsd (using the graphical editor). This adaptor looks at a
table in an Access database connected to the dataset. When added a query
was
added that filled the complete table. The dataset, table-adaptor, and
associated binding-source are placed on a form (a MDI form, this should
not
make any difference); the table is filled when the form is loaded.
I then added the two queries shown in the original message. The first
query
returns a 5 column table with anywhere from between 0 and 5 rows; each
column
has an aliases to provide column headers. The second query returns 3
derived
columns with an aliases and returns one row. These both only return one
table and are simple queries on a simple table.
The question is:
How do i use the columns and aliases in the queries and only those
columns?
What seems to be returned is the complete underlying table columns and the
rows requested.
I assumed that the dataset is a typed data set, so I should be able to see
the columns in the IntelliSense list in the code editor, which I do not.
In
addition, they are not to be found in the Autos or Local windows when a
set a
brake point after executing the code shown in the original message.
On the first query, I have worked it out so I can use it with the flex
grid
form ComponentOne. I am use the flex grid because of some unique features
I
wanted.
The real problem is the second query:
I want the max and min to use in code. It looks like the only way I can
use
them is assuming the number of columns in the original table and taking
the
next three in a generic ItemArray. This is very poor programming
techniques
and tightly couples the database to the program, which I do not want.
Does this clarify what I want?
Thank you for your help.

--
Mike Reed


Michael D. Reed said:
I have a data set called "ProductDataSet.xsd" that include several tables
one
called [Drive Packages] with 14 columns and several rows of data. The
table
adaptor attached to this is a table adapter called "Drive Package
TableAdapter". To this table adapter I have added several queries:

One called list Data
SELECT [Drive Package ID], [Drive Nomenclature] AS Drive,
[HP Max] AS HP, [RPM Max] AS [Max RPM],
[RPM Min] AS [Min RPM]
FROM [Drive Package]
WHERE ([Product Line ID] = ProductLineID) AND ([Unit Size] =
UnitSize)
ORDER BY [Drive Nomenclature]
The two procedures are called FillListData and GetByListdata
When I excite the following statement
DataTable ListData =
this.drive_PackageTableAdapter.GetListData(ProductLineID, UnitSize);
The columns I have aliased above are now where to be seen. For this
quarry
I did not need them explicitly because I bound them to a C1 flex grid.
Although, I did have to make five columns in the right order and names.
Note
I the correct amount of rows for the where clause.

The second one Max Mins
SELECT MAX([HP Max]) AS MaxHPMax, MIN([RPM Min]) AS MinRPMMin,
MAX([RPM Max]) AS MaxRPMMax
FROM [Drive Package]
WHERE (([Product Line ID] = ProductLineID) AND ([Unit Size] =
UnitSize));
The two procedures are called FillMaxMins and GetMaxMins.
Again exciting
DataTable dataMaxMins = this.drive_PackageTableAdapter.GetMaxMins(2,
"086");
The aliases are no where to be seen. This one returns only one record
and
it did. So I tried:
object[] MaxMins = new object[3];
MaxMins = this.drive_PackageTableAdapter.GetMaxMins(2,
"086").Rows[0].ItemArray;
And I can see the data I want but it is tacken on the end of an array of
14
items. One for each column in the orignal table and the there ones
above.

The question is how do I get the coliums in the quary and only the colums
in
the quary? These are not complacte quaries and if I can not use the
dataset
for these what good is it.
 
G

Guest

Cor
Let me be clearer, forget about the grids and displaying the data. I just
need to get some values out of columns in a query.
The setup:
In an XDS file, I have a table adaptor name [Drive Packages]
To this table adaptor, using the query wizard I have added several queries
two are:
One used in the default Fill and GetData functions the underlying SQL is:
SELECT [Drive Package ID], [Drive Nomenclature], [Product Line ID],
[Unit Size], [Base Costs], [CFM HP Coefficent A0],
[CFM HP Coefficent A1], [CFM HP Coefficent A2],
[CFM equation motor HP], [Ext Static Pressure k
Coefficients],
[HP Max], [RPM Max], [RPM Min], [CFM equation RPM]
FROM [Drive Package]
The second used n FillMaxMins and GetMaxMins functions the underlying SQL is:
SELECT MAX([HP Max]) AS MaxHPMax,
MIN([RPM Min]) AS MinRPMMin,
MAX([RPM Max]) AS MaxRPMMax
FROM [Drive Package]
WHERE (([Product Line ID] = ProductLineID) AND ([Unit Size] = UnitSize));
Not there is no Join here these are just simple Queries on a simple table.
On the form, I have placed the following
productDataSet, drivePackegsBindingSource, and drive_PackageTableAdapter
I execute the following statement to fill the drive_PackageTableAdapter.
this.drive_PackageTableAdapter.Fill(this.productDataSet.Drive_Package);
I have only one question?
Given a value for ProductLineID and UnitSize what is the code to execute
either the FillMaxMins or GetMaxMins and what is the code to bet the values
in MaxHPMax, MinRPMMin, and MaxRPMMax?
I do not want to display this data I need the data in a variables to use in
code.
The reference you gave me does not make sense because I do not see where I
am using data views.
Thank you,
--
Mike Reed


Cor Ligthert said:
Michael,

Do you mean that you want selective use some columns from a datatable.

Your text is so long and contains so many elements which I can not place in
connection with the problem that it confuses at least me.

If the first sentence is your question than the answer can be this.

Dataview.totable(overloaded)
http://msdn2.microsoft.com/en-us/library/h2b6ehaa.aspx

Be aware that the result is than not a typed dataset from format 1.x or 2.0
because those are closed classes that assume that you do your column
selections for grids using the complex data controls. This is in fact a very
strange to use method and as often said by others in this newsgroup "a not
needed possibility".

If you want to do it with your flexgrid, why than not contact ComponentOne?

Cor




Michael D. Reed said:
Let me explain father:
The first I had add a table adaptor to an existing dataset call
productDataSet.xsd (using the graphical editor). This adaptor looks at a
table in an Access database connected to the dataset. When added a query
was
added that filled the complete table. The dataset, table-adaptor, and
associated binding-source are placed on a form (a MDI form, this should
not
make any difference); the table is filled when the form is loaded.
I then added the two queries shown in the original message. The first
query
returns a 5 column table with anywhere from between 0 and 5 rows; each
column
has an aliases to provide column headers. The second query returns 3
derived
columns with an aliases and returns one row. These both only return one
table and are simple queries on a simple table.
The question is:
How do i use the columns and aliases in the queries and only those
columns?
What seems to be returned is the complete underlying table columns and the
rows requested.
I assumed that the dataset is a typed data set, so I should be able to see
the columns in the IntelliSense list in the code editor, which I do not.
In
addition, they are not to be found in the Autos or Local windows when a
set a
brake point after executing the code shown in the original message.
On the first query, I have worked it out so I can use it with the flex
grid
form ComponentOne. I am use the flex grid because of some unique features
I
wanted.
The real problem is the second query:
I want the max and min to use in code. It looks like the only way I can
use
them is assuming the number of columns in the original table and taking
the
next three in a generic ItemArray. This is very poor programming
techniques
and tightly couples the database to the program, which I do not want.
Does this clarify what I want?
Thank you for your help.

--
Mike Reed


Michael D. Reed said:
I have a data set called "ProductDataSet.xsd" that include several tables
one
called [Drive Packages] with 14 columns and several rows of data. The
table
adaptor attached to this is a table adapter called "Drive Package
TableAdapter". To this table adapter I have added several queries:

One called list Data
SELECT [Drive Package ID], [Drive Nomenclature] AS Drive,
[HP Max] AS HP, [RPM Max] AS [Max RPM],
[RPM Min] AS [Min RPM]
FROM [Drive Package]
WHERE ([Product Line ID] = ProductLineID) AND ([Unit Size] =
UnitSize)
ORDER BY [Drive Nomenclature]
The two procedures are called FillListData and GetByListdata
When I excite the following statement
DataTable ListData =
this.drive_PackageTableAdapter.GetListData(ProductLineID, UnitSize);
The columns I have aliased above are now where to be seen. For this
quarry
I did not need them explicitly because I bound them to a C1 flex grid.
Although, I did have to make five columns in the right order and names.
Note
I the correct amount of rows for the where clause.

The second one Max Mins
SELECT MAX([HP Max]) AS MaxHPMax, MIN([RPM Min]) AS MinRPMMin,
MAX([RPM Max]) AS MaxRPMMax
FROM [Drive Package]
WHERE (([Product Line ID] = ProductLineID) AND ([Unit Size] =
UnitSize));
The two procedures are called FillMaxMins and GetMaxMins.
Again exciting
DataTable dataMaxMins = this.drive_PackageTableAdapter.GetMaxMins(2,
"086");
The aliases are no where to be seen. This one returns only one record
and
it did. So I tried:
object[] MaxMins = new object[3];
MaxMins = this.drive_PackageTableAdapter.GetMaxMins(2,
"086").Rows[0].ItemArray;
And I can see the data I want but it is tacken on the end of an array of
14
items. One for each column in the orignal table and the there ones
above.

The question is how do I get the coliums in the quary and only the colums
in
the quary? These are not complacte quaries and if I can not use the
dataset
for these what good is it.
 
C

Cor Ligthert [MVP]

Michael,

There are more versions of the strongly typed dataset, Net 1.x, ASPNET 2.0
and Winforms 2.0. While the most active in this newsgroup are not really
biased on those strongly typed dataset.

Your select in a table adapter returns in any way a datatable. That can be
strongly typed, but that is still based on the DataTable class (it is
inheriting that).

A datatable can forever be processed in a non strongly typed way.
BaseDataTable.Columns(0).Columnname gives you the first columname.
(BaseDataTable is the name of the non strongly typed datatable in this
example)
http://msdn2.microsoft.com/en-us/library/system.data.datacolumn.columnname.aspx
(Another way is just to set the "show all" in the solution explorer to true
and than investigate what the wizard has created).

If you are using datatables, than you are forever using dataviews. In the
datatable class is the property defaultview, which is the inbuild dataview
in every datatable.
http://msdn2.microsoft.com/en-us/library/system.data.datatable.defaultview.aspx

that totable that I showed in my previous reply can be something as
dim newdatatable as datatable =
myolddatatable.defaultview.totable("MyDataTable",,"MaxHPMax","MinRPMMin")

I hope this helps,

Cor

Michael D. Reed said:
Cor
Let me be clearer, forget about the grids and displaying the data. I just
need to get some values out of columns in a query.
The setup:
In an XDS file, I have a table adaptor name [Drive Packages]
To this table adaptor, using the query wizard I have added several queries
two are:
One used in the default Fill and GetData functions the underlying SQL is:
SELECT [Drive Package ID], [Drive Nomenclature], [Product Line ID],
[Unit Size], [Base Costs], [CFM HP Coefficent A0],
[CFM HP Coefficent A1], [CFM HP Coefficent A2],
[CFM equation motor HP], [Ext Static Pressure k
Coefficients],
[HP Max], [RPM Max], [RPM Min], [CFM equation RPM]
FROM [Drive Package]
The second used n FillMaxMins and GetMaxMins functions the underlying SQL
is:
SELECT MAX([HP Max]) AS MaxHPMax,
MIN([RPM Min]) AS MinRPMMin,
MAX([RPM Max]) AS MaxRPMMax
FROM [Drive Package]
WHERE (([Product Line ID] = ProductLineID) AND ([Unit Size] = UnitSize));
Not there is no Join here these are just simple Queries on a simple table.
On the form, I have placed the following
productDataSet, drivePackegsBindingSource, and drive_PackageTableAdapter
I execute the following statement to fill the drive_PackageTableAdapter.
this.drive_PackageTableAdapter.Fill(this.productDataSet.Drive_Package);
I have only one question?
Given a value for ProductLineID and UnitSize what is the code to execute
either the FillMaxMins or GetMaxMins and what is the code to bet the
values
in MaxHPMax, MinRPMMin, and MaxRPMMax?
I do not want to display this data I need the data in a variables to use
in
code.
The reference you gave me does not make sense because I do not see where I
am using data views.
Thank you,
--
Mike Reed


Cor Ligthert said:
Michael,

Do you mean that you want selective use some columns from a datatable.

Your text is so long and contains so many elements which I can not place
in
connection with the problem that it confuses at least me.

If the first sentence is your question than the answer can be this.

Dataview.totable(overloaded)
http://msdn2.microsoft.com/en-us/library/h2b6ehaa.aspx

Be aware that the result is than not a typed dataset from format 1.x or
2.0
because those are closed classes that assume that you do your column
selections for grids using the complex data controls. This is in fact a
very
strange to use method and as often said by others in this newsgroup "a
not
needed possibility".

If you want to do it with your flexgrid, why than not contact
ComponentOne?

Cor




Michael D. Reed said:
Let me explain father:
The first I had add a table adaptor to an existing dataset call
productDataSet.xsd (using the graphical editor). This adaptor looks at
a
table in an Access database connected to the dataset. When added a
query
was
added that filled the complete table. The dataset, table-adaptor, and
associated binding-source are placed on a form (a MDI form, this should
not
make any difference); the table is filled when the form is loaded.
I then added the two queries shown in the original message. The first
query
returns a 5 column table with anywhere from between 0 and 5 rows; each
column
has an aliases to provide column headers. The second query returns 3
derived
columns with an aliases and returns one row. These both only return
one
table and are simple queries on a simple table.
The question is:
How do i use the columns and aliases in the queries and only those
columns?
What seems to be returned is the complete underlying table columns and
the
rows requested.
I assumed that the dataset is a typed data set, so I should be able to
see
the columns in the IntelliSense list in the code editor, which I do
not.
In
addition, they are not to be found in the Autos or Local windows when a
set a
brake point after executing the code shown in the original message.
On the first query, I have worked it out so I can use it with the flex
grid
form ComponentOne. I am use the flex grid because of some unique
features
I
wanted.
The real problem is the second query:
I want the max and min to use in code. It looks like the only way I
can
use
them is assuming the number of columns in the original table and taking
the
next three in a generic ItemArray. This is very poor programming
techniques
and tightly couples the database to the program, which I do not want.
Does this clarify what I want?
Thank you for your help.

--
Mike Reed


:

I have a data set called "ProductDataSet.xsd" that include several
tables
one
called [Drive Packages] with 14 columns and several rows of data. The
table
adaptor attached to this is a table adapter called "Drive Package
TableAdapter". To this table adapter I have added several queries:

One called list Data
SELECT [Drive Package ID], [Drive Nomenclature] AS Drive,
[HP Max] AS HP, [RPM Max] AS [Max RPM],
[RPM Min] AS [Min RPM]
FROM [Drive Package]
WHERE ([Product Line ID] = ProductLineID) AND ([Unit Size] =
UnitSize)
ORDER BY [Drive Nomenclature]
The two procedures are called FillListData and GetByListdata
When I excite the following statement
DataTable ListData =
this.drive_PackageTableAdapter.GetListData(ProductLineID, UnitSize);
The columns I have aliased above are now where to be seen. For this
quarry
I did not need them explicitly because I bound them to a C1 flex grid.
Although, I did have to make five columns in the right order and
names.
Note
I the correct amount of rows for the where clause.

The second one Max Mins
SELECT MAX([HP Max]) AS MaxHPMax, MIN([RPM Min]) AS MinRPMMin,
MAX([RPM Max]) AS MaxRPMMax
FROM [Drive Package]
WHERE (([Product Line ID] = ProductLineID) AND ([Unit Size] =
UnitSize));
The two procedures are called FillMaxMins and GetMaxMins.
Again exciting
DataTable dataMaxMins = this.drive_PackageTableAdapter.GetMaxMins(2,
"086");
The aliases are no where to be seen. This one returns only one record
and
it did. So I tried:
object[] MaxMins = new object[3];
MaxMins = this.drive_PackageTableAdapter.GetMaxMins(2,
"086").Rows[0].ItemArray;
And I can see the data I want but it is tacken on the end of an array
of
14
items. One for each column in the orignal table and the there ones
above.

The question is how do I get the coliums in the quary and only the
colums
in
the quary? These are not complacte quaries and if I can not use the
dataset
for these what good is it.
 

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