C
Corey Wirun
Hi Gang,
The latest in a string of messages dealing with Strongly Typed DataSets.
I've got a Strongly Typed DataSet 'filled', but I cannot seem to figure out
how to traverse it.
My typed DataSet is called 'RPDCY_TDataSet'. It has three columns: TAG,
SRC_TAG, DST_TAG. The class was generated with xsd.exe from an XML Schema
file (scraped from a database table):
RPDCY_TDataSet dsData = new RPDCY_TDataSet();
int nRows = daNew.Fill( dsData, "DATA" ); // daNew is an
OleDbDataAdapter. nRows = 55
foreach ( DataTable tbl in dsData.Tables )
DiagnosticLog.Debug( tbl.TableName ); // prints RPDCY_T and DATA
DiagnosticLog.Debug( "# rows = " + dsData.Tables[
"DATA" ].Rows.Count.ToString() ); // prints 55 rows
DiagnosticLog.Debug( "# rows = " + dsData.RPDCY_T.Rows.Count.ToString() );
// prints 0 rows, not expected
foreach ( RPDCY_TDataSet.RPDCY_TRow row in dsData.RPDCY_T.Rows ) //
doesn't execute anything - no rows
DiagnosticLog.Debug( row.TAG.ToString() + " " + row.SRC_TAG.ToString() +
" " + row.DST_TAG.ToString() );
So am I doing something wrong when referencing my Rows of my types DataSet
class?
Thanks for any advice!
Corey.
The latest in a string of messages dealing with Strongly Typed DataSets.
I've got a Strongly Typed DataSet 'filled', but I cannot seem to figure out
how to traverse it.
My typed DataSet is called 'RPDCY_TDataSet'. It has three columns: TAG,
SRC_TAG, DST_TAG. The class was generated with xsd.exe from an XML Schema
file (scraped from a database table):
RPDCY_TDataSet dsData = new RPDCY_TDataSet();
int nRows = daNew.Fill( dsData, "DATA" ); // daNew is an
OleDbDataAdapter. nRows = 55
foreach ( DataTable tbl in dsData.Tables )
DiagnosticLog.Debug( tbl.TableName ); // prints RPDCY_T and DATA
DiagnosticLog.Debug( "# rows = " + dsData.Tables[
"DATA" ].Rows.Count.ToString() ); // prints 55 rows
DiagnosticLog.Debug( "# rows = " + dsData.RPDCY_T.Rows.Count.ToString() );
// prints 0 rows, not expected
foreach ( RPDCY_TDataSet.RPDCY_TRow row in dsData.RPDCY_T.Rows ) //
doesn't execute anything - no rows
DiagnosticLog.Debug( row.TAG.ToString() + " " + row.SRC_TAG.ToString() +
" " + row.DST_TAG.ToString() );
So am I doing something wrong when referencing my Rows of my types DataSet
class?
Thanks for any advice!
Corey.