473,804 Members | 2,100 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

DataSet save to XML with a d2p1:

I have to save a dataset to xml and for efficiency I like to get rid of the
namespace prefix d2p1: can any one help

thanks

jaime
Nov 15 '05 #1
4 6234
Jaime,

You can't just do that. If the namespace was written to the data set,
then it will certainly be needed to validate the contents when you read the
data set back in.

Why do you want to get rid of it? I can understand for efficiency, but
if you need to get the data back into a dataset (don't say you never will,
those things have a tendency to come back to haunt you), then you will
prevent yourself from doing so.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard. caspershouse.co m

"Jaime" <j.******@haysd t.co.uk> wrote in message
news:ut******** ******@TK2MSFTN GP10.phx.gbl...
I have to save a dataset to xml and for efficiency I like to get rid of the namespace prefix d2p1: can any one help

thanks

jaime

Nov 15 '05 #2
Thanks for the anwser but the namespace its not in the xsd from which I
created the dataset in the first place.
and the xsd would let me load the xml back to the dataset.

So I still have the problem

Thanks

any clarification is welcome

jaime

"Nicholas Paldino [.NET/C# MVP]" <mv*@spam.guard .caspershouse.c om> wrote in
message news:uQ******** *****@TK2MSFTNG P11.phx.gbl...
Jaime,

You can't just do that. If the namespace was written to the data set,
then it will certainly be needed to validate the contents when you read the data set back in.

Why do you want to get rid of it? I can understand for efficiency, but if you need to get the data back into a dataset (don't say you never will,
those things have a tendency to come back to haunt you), then you will
prevent yourself from doing so.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard. caspershouse.co m

"Jaime" <j.******@haysd t.co.uk> wrote in message
news:ut******** ******@TK2MSFTN GP10.phx.gbl...
I have to save a dataset to xml and for efficiency I like to get rid of

the
namespace prefix d2p1: can any one help

thanks

jaime


Nov 15 '05 #3
Jaime,

Where did the XSD come from? If the DataSet created it, then I would
think that it is needed. Can you cut and paste the XML?

If it is not needed then you should have no problem cycling through the
nodes and copying them to a new dataset (or even just doing some text
parsing and removing the namespace prefix).
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard. caspershouse.co m

"Jaime" <j.******@haysd t.co.uk> wrote in message
news:uS******** ******@TK2MSFTN GP10.phx.gbl...
Thanks for the anwser but the namespace its not in the xsd from which I
created the dataset in the first place.
and the xsd would let me load the xml back to the dataset.

So I still have the problem

Thanks

any clarification is welcome

jaime

"Nicholas Paldino [.NET/C# MVP]" <mv*@spam.guard .caspershouse.c om> wrote in message news:uQ******** *****@TK2MSFTNG P11.phx.gbl...
Jaime,

You can't just do that. If the namespace was written to the data set, then it will certainly be needed to validate the contents when you read

the
data set back in.

Why do you want to get rid of it? I can understand for efficiency,

but
if you need to get the data back into a dataset (don't say you never will, those things have a tendency to come back to haunt you), then you will
prevent yourself from doing so.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard. caspershouse.co m

"Jaime" <j.******@haysd t.co.uk> wrote in message
news:ut******** ******@TK2MSFTN GP10.phx.gbl...
I have to save a dataset to xml and for efficiency I like to get rid
of the
namespace prefix d2p1: can any one help

thanks

jaime



Nov 15 '05 #4

Hi Jaime,

Does your dataset generated from a xml file or from a datatable of database?
I think if your dataset generates from database, the WriteXml method will
not generate the namespace prefix.
However, you also can use the DataSet or Datatable's Namespace, Prefix
property to add to it.
So I think you also can set Namespace, Prefix property to String.Empty to
get what your want.

Best regards,
Jeffrey Tan
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.

--------------------
| From: "Jaime" <j.******@haysd t.co.uk>
| References: <ut************ **@TK2MSFTNGP10 .phx.gbl>
<uQ************ *@TK2MSFTNGP11. phx.gbl>
| Subject: Re: DataSet save to XML with a d2p1:
| Date: Wed, 29 Oct 2003 13:47:40 -0000
| Lines: 51
| X-Priority: 3
| X-MSMail-Priority: Normal
| X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
| Message-ID: <uS************ **@TK2MSFTNGP10 .phx.gbl>
| Newsgroups: microsoft.publi c.dotnet.langua ges.csharp
| NNTP-Posting-Host: 193.195.51.178
| Path: cpmsftngxa06.ph x.gbl!TK2MSFTNG P08.phx.gbl!TK2 MSFTNGP10.phx.g bl
| Xref: cpmsftngxa06.ph x.gbl microsoft.publi c.dotnet.langua ges.csharp:1950 44
| X-Tomcat-NG: microsoft.publi c.dotnet.langua ges.csharp
|
| Thanks for the anwser but the namespace its not in the xsd from which I
| created the dataset in the first place.
| and the xsd would let me load the xml back to the dataset.
|
| So I still have the problem
|
| Thanks
|
| any clarification is welcome
|
| jaime
|
|
|
| "Nicholas Paldino [.NET/C# MVP]" <mv*@spam.guard .caspershouse.c om> wrote
in
| message news:uQ******** *****@TK2MSFTNG P11.phx.gbl...
| > Jaime,
| >
| > You can't just do that. If the namespace was written to the data
set,
| > then it will certainly be needed to validate the contents when you read
| the
| > data set back in.
| >
| > Why do you want to get rid of it? I can understand for efficiency,
| but
| > if you need to get the data back into a dataset (don't say you never
will,
| > those things have a tendency to come back to haunt you), then you will
| > prevent yourself from doing so.
| >
| > Hope this helps.
| >
| >
| > --
| > - Nicholas Paldino [.NET/C# MVP]
| > - mv*@spam.guard. caspershouse.co m
| >
| > "Jaime" <j.******@haysd t.co.uk> wrote in message
| > news:ut******** ******@TK2MSFTN GP10.phx.gbl...
| > > I have to save a dataset to xml and for efficiency I like to get rid
of
| > the
| > > namespace prefix d2p1: can any one help
| > >
| > > thanks
| > >
| > > jaime
| > >
| > >
| >
| >
|
|
|

Nov 15 '05 #5

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

Similar topics

0
336
by: william | last post by:
Hi, Here is what I've done: 1. create a XML schema for creating typed dataset. 2. declare a typed dataset as the XML schema of step 1. 3. when I fill the dataset of step 2, I applied table mapping. 4. call dataset.GetXML function to get a xml string. When I checked the xml file, I found a few attributes with d2p1 namespace, for example, <mem_plan mem_key="111" mem_hire="2003/1/2" d2p1:salary_min="0"
1
8127
by: Shaileen Patel | last post by:
Hi, I am trying to convert a lot of web reports from ASP/VB to ASP.NET/VB.NET. I would like to save my dataset in XML and then use XSLT to transform the XML. The catch is I would like to have the XML in the format that ADO uses versus the default format in which ADO.NET uses. Currently, I am using ADO within .NET, but I am concerned about the performance and it might improve if I used the native data providers for .NET. I am not sure if...
4
2853
by: Filippo Pandiani | last post by:
I have a grid that shows the file list from a folder. On the postback, how do I get a Dataset from this grid? Thanks, Filippo.
0
1122
by: Opie | last post by:
When using DataSet.WriteXml to write out the data of a dataset, it appends d2p1 to the beginning of each of the attribute names, which causes the program to crash on a subsequent load, as the attributes it expects don't exist any more. I have it done like so: ds1.WriteXml(fw); where fw is a System.IO.Stream with read/write access to the xml file I'm working with and ds1 is, of course, my data set.
2
4829
by: Alpha | last post by:
Hi, I have a window based program. One of the form has several textboxes and a datagrid. The textboxes are bind to the same dataset table as the datagrid and the text changes to reflect different row selected in the datagrid. I want to save the changes that user make in the textboxes when they select a different row in the datagrid. I tried capturing the textbox.text at datagrid's CurrentCellChanged event but by then the textbox.text...
4
3606
by: J.C.Rivera | last post by:
Hello... I'm a rookie to c#. So let me see if i can expose properly my situation. I developed a stored procedure in sql server 2000 that allows me to construct my dataset in XML format. the sp's output will look something similar to this: <table1 column11="value111" column12="value112" column13="value113" /> <table1 column12="value121" column2="value122" column3="value123" /> <table2 column21="value211" column2="value212"...
3
2058
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...
0
1129
by: Joe | last post by:
Hi I have a Typed Dataset (TDS) and am using the derived class. I wrote a wrapper Class around the TDS class to manipulate the class {Add,Delete, return Dataset etc} - All is fine except when I add a record If I step thru the code the record is added to the TDS but when I return a reference to that TDS to the calling pgm the row is missing
1
2885
by: JD | last post by:
I have a DataGridView with a DataSet as DataSource. The user can update the contents of the DataGridView, and then click on a Save button to save the data to an XML file. When they click on Save, I call the subroutine below. The first time that I call it, it works fine. However, if the user makes some more changes in the DataGridView and then wants to save again, I get the following error message: "DataSet can be associated with at...
0
9712
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
10595
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...
1
10341
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10089
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
9171
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...
1
7634
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
6862
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
5673
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
3001
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.