473,722 Members | 2,161 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Accessing DataSet

Hi,

I have the following loaded into a dataset:

<xml version="1.0" encoding="UTF-16">
<xml xmlns:s="uuid:B DC6E3F0-6DA3-11d1-A2A3-00AA00C14882"
xmlns:dt="uuid: C2F41010-65B3-11d1-A29F-00AA00C14882"
xmlns:rs="urn:s chemas-microsoft-com:rowset" xmlns:z="#Rowse tSchema">
<s:Schema id="RowsetSchem a">
<s:ElementTyp e name="row" content="eltOnl y"
rs:CommandTimeo ut="30">
<s:AttributeTyp e name="CustomerI D" rs:number="1"
rs:writeunknown ="true">
<s:datatype dt:type="string " dt:maxLength="5 "
rs:fixedlength= "true" rs:maybenull="f alse" />
</s:AttributeType >
<s:AttributeTyp e name="CompanyNa me" rs:number="2"
rs:writeunknown ="true">
<s:datatype dt:type="string " dt:maxLength="4 0"
rs:maybenull="f alse" />
</s:AttributeType >
<s:AttributeTyp e name="ContactNa me" rs:number="3"
rs:nullable="tr ue" rs:writeunknown ="true">
<s:datatype dt:type="string " dt:maxLength="3 0" />
</s:AttributeType >
<s:AttributeTyp e name="ContactTi tle" rs:number="4"
rs:nullable="tr ue" rs:writeunknown ="true">
<s:datatype dt:type="string " dt:maxLength="3 0" />
</s:AttributeType >
<s:AttributeTyp e name="Address" rs:number="5"
rs:nullable="tr ue" rs:writeunknown ="true">
<s:datatype dt:type="string " dt:maxLength="6 0" />
</s:AttributeType >
<s:AttributeTyp e name="City" rs:number="6"
rs:nullable="tr ue" rs:writeunknown ="true">
<s:datatype dt:type="string " dt:maxLength="1 5" />
</s:AttributeType >
<s:AttributeTyp e name="Region" rs:number="7"
rs:nullable="tr ue" rs:writeunknown ="true">
<s:datatype dt:type="string " dt:maxLength="1 5" />
</s:AttributeType >
<s:AttributeTyp e name="PostalCod e" rs:number="8"
rs:nullable="tr ue" rs:writeunknown ="true">
<s:datatype dt:type="string " dt:maxLength="1 0" />
</s:AttributeType >
<s:AttributeTyp e name="Country" rs:number="9"
rs:nullable="tr ue" rs:writeunknown ="true">
<s:datatype dt:type="string " dt:maxLength="1 5" />
</s:AttributeType >
<s:AttributeTyp e name="Phone" rs:number="10"
rs:nullable="tr ue" rs:writeunknown ="true">
<s:datatype dt:type="string " dt:maxLength="2 4" />
</s:AttributeType >
<s:AttributeTyp e name="Fax" rs:number="11"
rs:nullable="tr ue" rs:writeunknown ="true">
<s:datatype dt:type="string " dt:maxLength="2 4" />
</s:AttributeType >
<s:extends type="rs:rowbas e" />
</s:ElementType>
</s:Schema>
<rs:data>
<z:row CustomerID="ALF KI" CompanyName="Al freds Futterkiste"
ContactName="Ma ria Anders"
ContactTitle="S ales Representative" Address="Obere Str. 57"
City="Berlin" PostalCode="122 09"
Country="German y" Phone="030-0074321" Fax="030-0076545" />
<z:row CustomerID="ANA TR" CompanyName="An a Trujillo Emparedados
y helados" ContactName="An a Trujillo"
ContactTitle="O wner" Address="Avda. de la Constitución 2222"
City="México D.F." PostalCode="050 21"
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 1314
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**@discussio ns.microsoft.co m> wrote in message
news:83******** *************** ***********@mic rosoft.com...
Hi,

I have the following loaded into a dataset:

<xml version="1.0" encoding="UTF-16">
<xml xmlns:s="uuid:B DC6E3F0-6DA3-11d1-A2A3-00AA00C14882"
xmlns:dt="uuid: C2F41010-65B3-11d1-A29F-00AA00C14882"
xmlns:rs="urn:s chemas-microsoft-com:rowset" xmlns:z="#Rowse tSchema"> <s:Schema id="RowsetSchem a">
<s:ElementTyp e name="row" content="eltOnl y"
rs:CommandTimeo ut="30">
<s:AttributeTyp e name="CustomerI D" rs:number="1"
rs:writeunknown ="true">
<s:datatype dt:type="string " dt:maxLength="5 "
rs:fixedlength= "true" rs:maybenull="f alse" />
</s:AttributeType >
<s:AttributeTyp e name="CompanyNa me" rs:number="2"
rs:writeunknown ="true">
<s:datatype dt:type="string " dt:maxLength="4 0"
rs:maybenull="f alse" />
</s:AttributeType >
<s:AttributeTyp e name="ContactNa me" rs:number="3"
rs:nullable="tr ue" rs:writeunknown ="true">
<s:datatype dt:type="string " dt:maxLength="3 0" />
</s:AttributeType >
<s:AttributeTyp e name="ContactTi tle" rs:number="4"
rs:nullable="tr ue" rs:writeunknown ="true">
<s:datatype dt:type="string " dt:maxLength="3 0" />
</s:AttributeType >
<s:AttributeTyp e name="Address" rs:number="5"
rs:nullable="tr ue" rs:writeunknown ="true">
<s:datatype dt:type="string " dt:maxLength="6 0" />
</s:AttributeType >
<s:AttributeTyp e name="City" rs:number="6"
rs:nullable="tr ue" rs:writeunknown ="true">
<s:datatype dt:type="string " dt:maxLength="1 5" />
</s:AttributeType >
<s:AttributeTyp e name="Region" rs:number="7"
rs:nullable="tr ue" rs:writeunknown ="true">
<s:datatype dt:type="string " dt:maxLength="1 5" />
</s:AttributeType >
<s:AttributeTyp e name="PostalCod e" rs:number="8"
rs:nullable="tr ue" rs:writeunknown ="true">
<s:datatype dt:type="string " dt:maxLength="1 0" />
</s:AttributeType >
<s:AttributeTyp e name="Country" rs:number="9"
rs:nullable="tr ue" rs:writeunknown ="true">
<s:datatype dt:type="string " dt:maxLength="1 5" />
</s:AttributeType >
<s:AttributeTyp e name="Phone" rs:number="10"
rs:nullable="tr ue" rs:writeunknown ="true">
<s:datatype dt:type="string " dt:maxLength="2 4" />
</s:AttributeType >
<s:AttributeTyp e name="Fax" rs:number="11"
rs:nullable="tr ue" rs:writeunknown ="true">
<s:datatype dt:type="string " dt:maxLength="2 4" />
</s:AttributeType >
<s:extends type="rs:rowbas e" />
</s:ElementType>
</s:Schema>
<rs:data>
<z:row CustomerID="ALF KI" CompanyName="Al freds Futterkiste"
ContactName="Ma ria Anders"
ContactTitle="S ales Representative" Address="Obere Str. 57" City="Berlin" PostalCode="122 09"
Country="German y" Phone="030-0074321" Fax="030-0076545" />
<z:row CustomerID="ANA TR" CompanyName="An a Trujillo Emparedados y helados" ContactName="An a Trujillo"
ContactTitle="O wner" Address="Avda. de la Constitución 2222" City="México D.F." PostalCode="050 21"
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
2254
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 System.IndexOutOfRangeException as if there are no rows. Yet when I dump the data to a file I receive (sample of file) <?xml version="1.0" standalone="yes"?><Dataset1 xmlns="http://tempuri.org/Dataset1.xsd"><Table><accountNo>1</accountNo><firstName>John ...
2
1582
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 names assigned I get errors. It doesn't seem to be assigning the names correctly within the stored procedure - instead it uses default names: Table, Table1 etc. e.g. Accessing using aDataSet.Tables
4
4876
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 create a web service in c# using paradox data. The data is stored locally on my development machine with IIS also installed. Web services are working to the point where I can return strings and ints using Access2000 data but whenever I try and...
0
1575
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 from accessing the 'latitude' and 'longitude' nodes is not a DataTable (as specified in the MSDN). I'm not sure what type is being returned, nor how to go about finding out. Any pointers would be appreciated. Below is the relevent Error message,...
2
366
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 System.IndexOutOfRangeException as if there are no rows. Yet when I dump the data to a file I receive (sample of file) <?xml version="1.0" standalone="yes"?><Dataset1 xmlns="http://tempuri.org/Dataset1.xsd"><Table><accountNo>1</accountNo><firstName>John ...
0
8863
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8739
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9384
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9238
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9088
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6681
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4502
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4762
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3207
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

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.