Home All Groups Group Topic Archive Search About

Table.Select and Strong Data Typed DataSets

Author
18 Jan 2006 1:47 PM
Rafael
I’m using Strong Data Types DataSets. Using it is great for several reasons,
one of them is creating new rows using NewTableRow, this row is not a simple
DataRow, but a complex DataRow with table fields as properties,
xmlSchemaWriting, etc..

But when you perform table.Select it returns a simple DataRow(), then you
are forced to access each field using field names and columnCollections. Is
there a way to perform a table.Select and having an array TableRow() as a
result?

--
Thanks in advance

Rafael

Author
18 Jan 2006 7:50 PM
Jesús López
You are not forced to use field names and columnCollections.

Please  try something like this:

For each row As As MyTypedDataSet.MyTableRow in
MyTypedDatasetInstance.MyTable.Select( .... )
    Debug.WriteLine ( row.SomeField.ToString() )
Next

Regards from Madrid (Spain)

Jesús López
VB MVP


Show quote
"Rafael" <Raf***@discussions.microsoft.com> escribió en el mensaje
news:A53A9C78-0D96-4ED5-BD39-608D59BF78A3@microsoft.com...
> I'm using Strong Data Types DataSets. Using it is great for several
> reasons,
> one of them is creating new rows using NewTableRow, this row is not a
> simple
> DataRow, but a complex DataRow with table fields as properties,
> xmlSchemaWriting, etc..
>
> But when you perform table.Select it returns a simple DataRow(), then you
> are forced to access each field using field names and columnCollections.
> Is
> there a way to perform a table.Select and having an array TableRow() as a
> result?
>
> --
> Thanks in advance
>
> Rafael
Author
18 Jan 2006 10:16 PM
mabster
Rafael wrote:
> I’m using Strong Data Types DataSets. Using it is great for several reasons,
> one of them is creating new rows using NewTableRow, this row is not a simple
> DataRow, but a complex DataRow with table fields as properties,
> xmlSchemaWriting, etc..
>
> But when you perform table.Select it returns a simple DataRow(), then you
> are forced to access each field using field names and columnCollections. Is
> there a way to perform a table.Select and having an array TableRow() as a
> result?

You can simply cast the return value of Select, like this:

myTableRow[] rows = (myTableRow[])myTable.Select("...");

AddThis Social Bookmark Button