473,387 Members | 1,771 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Getting Rows

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
1 1628
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

17
by: John Hunter | last post by:
I have a largish data set (1000 observations x 100 floating point variables), and some of the of the data are missing. I want to try a variety of clustering, neural network, etc, algorithms on the...
4
by: s99999999s2003 | last post by:
hi the database "execute" function returns a list of logical results. Each logical result is a list of row tuples, as explained in the documents. everytime i use it to execute various...
4
by: don.fleming | last post by:
Hi folks: Am doing a VBA SQL Select stmt with multiple rows found and not getting RecordCount > 1. I've verified there are multiple rows found by copying my SQL stmt from Debug window and pasting...
4
by: Richard G | last post by:
I'm a database guy, so go easy on me here. :) How can I get the rowcount of the affected rows of a SQL statement from a stored procedure call? I know that "set nocount on" does not return the...
3
by: luisg | last post by:
I am having some difficulty getting a checkboxlist control to determine which checkboxes are checked. Here is a code sample from the event that should read it: private void...
6
by: melanieab | last post by:
Hi, Easy question. It seems to me that I'm following the examples correctly, but apparently I'm not. I'm trying to retrieve the data from a row called "row" and a column called "File". This is...
1
by: macupryk | last post by:
I am not sure how to get a column from a datatable, I cannot use foreach. DataColumn dataColumn = DataColumn TEXTDT.Columns.ColumnName.Trim(); if (rows < TEXTDT.Rows.Count) // this will...
0
by: JimN1 | last post by:
Error: Update requires a valid UpdateCommand when passed DataRow collection with modified rows. This is a continuation of my previous table element update question. I am now getting the above...
10
by: Mike | last post by:
I have code that is doing some updating to a record. Its getting the ID to update from the Grid. I'm passing an INT to my method to update the record. My code is working though I'm still getting an...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.