By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,649 Members | 2,142 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,649 IT Pros & Developers. It's quick & easy.

Getting Rows

P: n/a
Hi,

I am really confused. I have created a strong typed dataset for Northwind
database Customer table. Now I am loading it with a stream of XML (ADO style)
with the following:

Customers _cust = new Customers();

XmlTextReader xmlReader = new XmlTextReader(stream);
stream.Position = 0;
_cust.ReadXml(stream, XmlReadMode.InferSchema);
Debug.Write(_cust.GetXml());

/* -- Debug.Write(_cust.GetXml()); --
<xml>
<rs:data xmlns:rs="urn:schemas-microsoft-com:rowset">
<z:row CustomerID="ALFKI" CompanyName="Alfreds Futterkiste"
ContactName="Maria Anders" ContactTitle="Sales Representative" Address="Obere
Str. 57" City="Berlin" PostalCode="12209" Country="Germany"
Phone="030-0074321" Fax="030-0076545" xmlns:z="#RowsetSchema" />
<z:row CustomerID="ANATR" CompanyName="Ana Trujillo Emparedados y
helados" ContactName="Ana Trujillo" ContactTitle="Owner" Address="Avda. de la
Constitución 2222" City="México D.F." PostalCode="05021" Country="Mexico"
Phone="(5) 555-4729" Fax="(5) 555-3745" xmlns:z="#RowsetSchema" />
<z:row CustomerID="ANTON" CompanyName="Antonio Moreno TaquerÃ*a"
ContactName="Antonio Moreno" ContactTitle="Owner" Address="Mataderos 2312"
City="México D.F." PostalCode="05023" Country="Mexico" Phone="(5) 555-3932"
xmlns:z="#RowsetSchema" />
</rs:data>
</xml>

*/
The problem is that I am getting no values in none of the rows:

foreach(DataRow dr in _cust.customers.Rows)
{
//-- NO VALUES
Debug.Write(Convert.ToString(dr[0]));
}

On the other hand I get all the column names using the following:

foreach(DataColumn dc in _cust.customers.Columns)
{
//-- I get each column name
Debug.Write(Convert.ToString(dc.ColumnName + "\r\n");
}
So how do I load the values into the typed dataset? Then access them to
modify a value... For example a column containing the date may need to be
modified before displaying it into a report.

REMARK: _cust.customers.Rows.Count return 0 while actually as we can see
above there are 3 rows.

Please help me!

~yamazed


Nov 12 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
I have Access 1.0
Also got Access 1.1 for error upgrades.

**********

Bought Access 2.0 $800
Bought Access 2.0 Developer Edition $800

Installed it on a $10.000 Gateway Dream Machine.

Access "1995" killed interoperability, the "VB" code,
my customers, my savings, and my business endeavours.
****************

I doubt those people from your example do still live at those
addresses or are still in business. But looks familiar.

===========

I believe this Access MS thing is a stupid US MS thing to fleece
upright people with non war interest.

=================

I believe you are a moron and a useless consumer that needs to
pay for the movie to play a role in.


"Yama" <Ya**@discussions.microsoft.com> wrote in message
news:5F**********************************@microsof t.com...
Hi,

I am really confused. I have created a strong typed dataset for Northwind
database Customer table. Now I am loading it with a stream of XML (ADO style) with the following:

Customers _cust = new Customers();

XmlTextReader xmlReader = new XmlTextReader(stream);
stream.Position = 0;
_cust.ReadXml(stream, XmlReadMode.InferSchema);
Debug.Write(_cust.GetXml());

/* -- Debug.Write(_cust.GetXml()); --
<xml>
<rs:data xmlns:rs="urn:schemas-microsoft-com:rowset">
<z:row CustomerID="ALFKI" CompanyName="Alfreds Futterkiste"
ContactName="Maria Anders" ContactTitle="Sales Representative" Address="Obere Str. 57" City="Berlin" PostalCode="12209" Country="Germany"
Phone="030-0074321" Fax="030-0076545" xmlns:z="#RowsetSchema" />
<z:row CustomerID="ANATR" CompanyName="Ana Trujillo Emparedados y
helados" ContactName="Ana Trujillo" ContactTitle="Owner" Address="Avda. de la Constitución 2222" City="México D.F." PostalCode="05021" Country="Mexico"
Phone="(5) 555-4729" Fax="(5) 555-3745" xmlns:z="#RowsetSchema" />
<z:row CustomerID="ANTON" CompanyName="Antonio Moreno TaquerÃ*a"
ContactName="Antonio Moreno" ContactTitle="Owner" Address="Mataderos 2312" City="México D.F." PostalCode="05023" Country="Mexico" Phone="(5) 555-3932" xmlns:z="#RowsetSchema" />
</rs:data>
</xml>

*/
The problem is that I am getting no values in none of the rows:

foreach(DataRow dr in _cust.customers.Rows)
{
//-- NO VALUES
Debug.Write(Convert.ToString(dr[0]));
}

On the other hand I get all the column names using the following:

foreach(DataColumn dc in _cust.customers.Columns)
{
//-- I get each column name
Debug.Write(Convert.ToString(dc.ColumnName + "\r\n");
}
So how do I load the values into the typed dataset? Then access them to
modify a value... For example a column containing the date may need to be
modified before displaying it into a report.

REMARK: _cust.customers.Rows.Count return 0 while actually as we can see
above there are 3 rows.

Please help me!

~yamazed


Nov 12 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.