XML Dataset Datareader

  • Thread starter Thread starter info
  • Start date Start date
I

info

Hi There!

First i developped a little testapp in VS.NET 2005 Beta.

I've to process an XML FIle. this worked int he following way fine:

Getting an DataSet of the XML File via ReadXML().

Then getting the Datatable .

on the Datatable I executed CreateReader() to get an Datareader so that
i can walk through the rows of the XML FIle.

Now in CF 1 I can't anymore create an Datareader of the Dataset , is
this right ? What am I doing wrong ? What do I have to adjust?

Thanks
 
According to MSDN CreateReader is supported only by CF2.0. To iterate
through rows of a table try something like this:

foreach(DataRow dr in YourTable.Rows)
{
string fieldName = dr["Name"];
...
}
 
DataTableReader was added to allow for easy switching of legacy
record-by-record applications to DataSet without changing them much.

For new applications it makes no sense whatsoever to use it as DataSet
offers direct access to any record and column.



object o = dataSet.Tables[0].Rows[1][2]; // Get value from column 2 in row
1 in table 0.



If you need to iterate through rows for some reason, just use this in the
loop.



Best regards,



Ilya



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

*** Want to find answers instantly? Here's how... ***

1. Go to
http://groups-beta.google.com/group/microsoft.public.dotnet.framework.compactframework?hl=en
2. Type your question in the text box near "Search this group" button.
3. Hit "Search this group" button.
4. Read answer(s).
 
Back
Top