473,395 Members | 1,443 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,395 software developers and data experts.

Accessing DataSet

Hi,

I have the following loaded into a dataset:

<xml version="1.0" encoding="UTF-16">
<xml xmlns:s="uuid:BDC6E3F0-6DA3-11d1-A2A3-00AA00C14882"
xmlns:dt="uuid:C2F41010-65B3-11d1-A29F-00AA00C14882"
xmlns:rs="urn:schemas-microsoft-com:rowset" xmlns:z="#RowsetSchema">
<s:Schema id="RowsetSchema">
<s:ElementType name="row" content="eltOnly"
rs:CommandTimeout="30">
<s:AttributeType name="CustomerID" rs:number="1"
rs:writeunknown="true">
<s:datatype dt:type="string" dt:maxLength="5"
rs:fixedlength="true" rs:maybenull="false" />
</s:AttributeType>
<s:AttributeType name="CompanyName" rs:number="2"
rs:writeunknown="true">
<s:datatype dt:type="string" dt:maxLength="40"
rs:maybenull="false" />
</s:AttributeType>
<s:AttributeType name="ContactName" rs:number="3"
rs:nullable="true" rs:writeunknown="true">
<s:datatype dt:type="string" dt:maxLength="30" />
</s:AttributeType>
<s:AttributeType name="ContactTitle" rs:number="4"
rs:nullable="true" rs:writeunknown="true">
<s:datatype dt:type="string" dt:maxLength="30" />
</s:AttributeType>
<s:AttributeType name="Address" rs:number="5"
rs:nullable="true" rs:writeunknown="true">
<s:datatype dt:type="string" dt:maxLength="60" />
</s:AttributeType>
<s:AttributeType name="City" rs:number="6"
rs:nullable="true" rs:writeunknown="true">
<s:datatype dt:type="string" dt:maxLength="15" />
</s:AttributeType>
<s:AttributeType name="Region" rs:number="7"
rs:nullable="true" rs:writeunknown="true">
<s:datatype dt:type="string" dt:maxLength="15" />
</s:AttributeType>
<s:AttributeType name="PostalCode" rs:number="8"
rs:nullable="true" rs:writeunknown="true">
<s:datatype dt:type="string" dt:maxLength="10" />
</s:AttributeType>
<s:AttributeType name="Country" rs:number="9"
rs:nullable="true" rs:writeunknown="true">
<s:datatype dt:type="string" dt:maxLength="15" />
</s:AttributeType>
<s:AttributeType name="Phone" rs:number="10"
rs:nullable="true" rs:writeunknown="true">
<s:datatype dt:type="string" dt:maxLength="24" />
</s:AttributeType>
<s:AttributeType name="Fax" rs:number="11"
rs:nullable="true" rs:writeunknown="true">
<s:datatype dt:type="string" dt:maxLength="24" />
</s:AttributeType>
<s:extends type="rs:rowbase" />
</s:ElementType>
</s:Schema>
<rs:data>
<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" />
<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" />
</rs:data>
</xml>
Now when I try to access a row:

foreach (DataRow dr in ds.Tables[0].Rows)
{
dr[0] = "0";
}

How could I change column names and change row values?

Thanks,

~yamazed
Nov 12 '05 #1
1 1301
Sorry, that did not make it into the visual zone of my OE Monitor
completely.

Don't you have some more crap to post.
"Yama" <Ya**@discussions.microsoft.com> wrote in message
news:83**********************************@microsof t.com...
Hi,

I have the following loaded into a dataset:

<xml version="1.0" encoding="UTF-16">
<xml xmlns:s="uuid:BDC6E3F0-6DA3-11d1-A2A3-00AA00C14882"
xmlns:dt="uuid:C2F41010-65B3-11d1-A29F-00AA00C14882"
xmlns:rs="urn:schemas-microsoft-com:rowset" xmlns:z="#RowsetSchema"> <s:Schema id="RowsetSchema">
<s:ElementType name="row" content="eltOnly"
rs:CommandTimeout="30">
<s:AttributeType name="CustomerID" rs:number="1"
rs:writeunknown="true">
<s:datatype dt:type="string" dt:maxLength="5"
rs:fixedlength="true" rs:maybenull="false" />
</s:AttributeType>
<s:AttributeType name="CompanyName" rs:number="2"
rs:writeunknown="true">
<s:datatype dt:type="string" dt:maxLength="40"
rs:maybenull="false" />
</s:AttributeType>
<s:AttributeType name="ContactName" rs:number="3"
rs:nullable="true" rs:writeunknown="true">
<s:datatype dt:type="string" dt:maxLength="30" />
</s:AttributeType>
<s:AttributeType name="ContactTitle" rs:number="4"
rs:nullable="true" rs:writeunknown="true">
<s:datatype dt:type="string" dt:maxLength="30" />
</s:AttributeType>
<s:AttributeType name="Address" rs:number="5"
rs:nullable="true" rs:writeunknown="true">
<s:datatype dt:type="string" dt:maxLength="60" />
</s:AttributeType>
<s:AttributeType name="City" rs:number="6"
rs:nullable="true" rs:writeunknown="true">
<s:datatype dt:type="string" dt:maxLength="15" />
</s:AttributeType>
<s:AttributeType name="Region" rs:number="7"
rs:nullable="true" rs:writeunknown="true">
<s:datatype dt:type="string" dt:maxLength="15" />
</s:AttributeType>
<s:AttributeType name="PostalCode" rs:number="8"
rs:nullable="true" rs:writeunknown="true">
<s:datatype dt:type="string" dt:maxLength="10" />
</s:AttributeType>
<s:AttributeType name="Country" rs:number="9"
rs:nullable="true" rs:writeunknown="true">
<s:datatype dt:type="string" dt:maxLength="15" />
</s:AttributeType>
<s:AttributeType name="Phone" rs:number="10"
rs:nullable="true" rs:writeunknown="true">
<s:datatype dt:type="string" dt:maxLength="24" />
</s:AttributeType>
<s:AttributeType name="Fax" rs:number="11"
rs:nullable="true" rs:writeunknown="true">
<s:datatype dt:type="string" dt:maxLength="24" />
</s:AttributeType>
<s:extends type="rs:rowbase" />
</s:ElementType>
</s:Schema>
<rs:data>
<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" />
<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" /> </rs:data>
</xml>
Now when I try to access a row:

foreach (DataRow dr in ds.Tables[0].Rows)
{
dr[0] = "0";
}

How could I change column names and change row values?

Thanks,

~yamazed


Nov 12 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: George Grodentzik | last post by:
I created a typed dataset from which I am trying to access the data. When I use the following code to access a row string name =dataset.person.firstName I receive an error...
2
by: KimD | last post by:
I'm filling a dataset with the return of a stored procedure. The dataset contains a number of tables which I am naming within the stored procedure, however when I try to access the tables using the...
4
by: Eugen Walcher | last post by:
Hello all, I've tried posting this same question on other newsgroups with no luck. This group seems to have a lot more activity so I apologize if you have seen it before. I'm trying to...
0
by: N. Demos | last post by:
Hello, I'm having problems accessing a complex XML child node (latitude & longitude), and passing it to a function when the XML file has been read into a DataSet. Specifically, the returned object...
2
by: George Grodentzik | last post by:
I created a typed dataset from which I am trying to access the data. When I use the following code to access a row string name =dataset.person.firstName I receive an error...
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: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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: 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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

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.