473,729 Members | 2,243 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

DataSet Xml Issue

Hi,
I am trying to use the GetXml() function of my DataSet, and its returning
all the rows and their values correctly in Elements format. How can i change
this default behaviour of the GetXml() function to return the embedded nodes
as an Attribute of an entity and not ChildNodes, e.g.

The DataSet's GetXml function returns like this

<File>
<FileName>some. xml</FileName>
<FileType>Xml </FileType>
</File>

I want it to return like this

<File FileName="some. xml" FileType="Xml" />

Please suggest. . .

Thanks!

With Regards
Sunny
Nov 16 '05 #1
1 1623
Got it, thanks for looking, this is the solution... for anyone else interested.

1. If you are creating a new DataSet and its tables then while creating the
columns u can specify for each column's ColumnMapping property and making its
type as MappingType.Att ribute. Then it will be emitted as an attribute of
the entity.

2. If the dataset is populated through a DataAdapter, then u can iterate
through the columns of the dataset tables and make their ColumnMappin
property as Attribute.

Thanks!

"Sunny" wrote:
Hi,
I am trying to use the GetXml() function of my DataSet, and its returning
all the rows and their values correctly in Elements format. How can i change
this default behaviour of the GetXml() function to return the embedded nodes
as an Attribute of an entity and not ChildNodes, e.g.

The DataSet's GetXml function returns like this

<File>
<FileName>some. xml</FileName>
<FileType>Xml </FileType>
</File>

I want it to return like this

<File FileName="some. xml" FileType="Xml" />

Please suggest. . .

Thanks!

With Regards
Sunny

Nov 16 '05 #2

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

Similar topics

2
2022
by: Programatix | last post by:
Hi, I'm working on a project which includes WebServices and Windows Form application. The Windows Form application will call the WebServices to retrieve data from database. The data will be returned as DataSet. Now, here's the problem. On .NET Framework 1.1, if any rows in the dataset returned contain errors (marked by calling the SetColumnError() method or
3
2547
by: Diego TERCERO | last post by:
Hi... I'm working on a tool for editing text resources for a family of software product my company produces. These text resources are found in a SQL Server database, in a table called "Resource" with the following structure : Resource{,en,fr,es} Yes.. these are the only languages supported actually. A couple of rows in that table would look like this :
3
2953
by: news.microsoft.com | last post by:
The question is, is a DataSet CLS compliant? Minimally implemented code, with an attribute in the assemblyinfo.cs compiles just fine (is it possibly the data INSIDE the dataset that could invalidate its compliancy?): using System; using System.Data; namespace ConsoleApplication1
5
1947
by: Sadun Sevingen | last post by:
hi i get dataset from'an webservice so i don't have an adaptor... dataset's structure is same as mine database table.... how can i update database table according to dataset...
16
2483
by: Geoff Jones | last post by:
Hi Can anybody help me with the following, hopefully simple, question? I have a table which I've connected to a dataset. I wish to add a new column to the beginning of the table and to fill it with incremental values e.g. if the tables looks like this: 23 56
3
2623
by: KillerJ | last post by:
I found a post about this exact issue: http://groups.google.com/group/microsoft.public.dotnet.xml/browse_thread/thread/1dfeb38170cb0b1/ea073666a4035bd5?lnk=st&q=decimal+parse+error+loading+dataset&rnum=6&hl=en#ea073666a4035bd5 but it only shows how to correct the issue manually, not whether it is a known bug. My situation is slightly different only in that the xml data and schema I have are coming directly from the DataSet using:...
3
2051
by: David P. Donahue | last post by:
I'm re-writing an application in C# that was originally written in Delphi 7. The heart of the application is a DataSet displayed in a DataGrid. One of the main functions of the previous application was to save the data to a file (it was XML, but the format is unimportant) that can be re-loaded into the DataSet at a later time. (The reason for this was that the queries which populate the DataSet can take a while to run, and people...
7
3364
by: =?Utf-8?B?ZG91Zw==?= | last post by:
Have loaded balanced web servers that we do not allow to connect to our database. Content is created and pushed to these sites. I want to add a web service that may get multiple requests a second depending on peak access. I have built an XML file from SQL DB and pushed this file to web server. I want to load XML file at application startup and leave it cached if possible (it will vary in size from 1-2MB) and treat it like an SQL table...
6
2485
by: Simone | last post by:
Hello Here is my issue, I created a crystal report using a data set from my xsd. Then I created a page with the crystal report viewer control and bound the report to it. When I try to view the report on the browser I get a logon page even though my dataset has a connection string saved within it. When I preview the data in the dataset I see it no problem. however the report doesn't seem to know that the dataset is there or that the
8
1406
by: Matt MacDonald | last post by:
Hi all, First of all, I am not trying to be the guy who comes in here shouting his mouth off at Microsoft. However, ever sinse I started using typed datasets in VS2005 I have been fighting with a recurring issue. I will have a project open and be working in it just fine, when all of a sudden when I try to do something in my dataset (either add a new query, modify and existing one, etc.) I get a big fat error box on my screen telling me...
0
8913
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
8761
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
9280
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
9142
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...
0
8144
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6016
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4795
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
2677
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2162
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.