Table.Select and Strong Data Typed DataSets

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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 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
 
Rafael said:
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("...");
 
Back
Top