473,761 Members | 10,057 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

XML in DataGrid: Saving inserts "preserve"

Hello all,

I am using an XmlTextReader and a DataSet to populate a DataGrid:

ds = New DataSet
xr = New XmlTextReader(p ath)
ds.ReadXml(xr)
xr.Close()

dv = New DataView(ds.Tab les.Item(0))
.... ' code to only show certain columns
DataGrid1.DataS ource = dv
Works fine. Then I am changing the data in the DataGrid and save the
changes:

ds.GetChanges()
ds.WriteXml(pat h, XmlWriteMode.Ig noreSchema)

Unfortunately it inserts for every empty element a xml:space="pres erve"
attribute into the XML file. (<name xml:space="pres erve" />) Now when I run
the application again the DataGrid only contains the non-empty elements i.e.
the ones without the xml:space="pres erve" attribute.

Does anyone know what goes wrong? How is it possible to save the DataGrid to
XML without the "preserve" attribute? Or why is my XMLReader ignoring the
elements containing the "preserve" attribute?

Environment: VB in VisualStudio 2005 (Compact Framework)

Thanks,
Jan

Nov 12 '05 #1
0 1343

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

Similar topics

14
2682
by: David B. Held | last post by:
I wanted to post this proposal on c.l.c++.m, but my news server apparently does not support that group any more. I propose a new class of exception safety known as the "smart guarantee". Essentially, the smart guarantee promises to clean up resources whose ownership is passed into the function, for whatever defintion of "clean up" is most appropriate for the resource passed. Note that this is different from both the basic and the...
3
2126
by: Phil | last post by:
Hi everybody, I am a XSLT beginner and the following problem really makes me crazy ! I have a main "contacts.xml" document which contains references to several contact data XML files. My aim is to process the contacts in a single-pass XSLT process. That is why the "document()" function is what I need. I call the "document()" XPath function from a "for-each" instruction.
27
11205
by: Abdullah Kauchali | last post by:
Hi folks, Can one rely on the order of keys inserted into an associative Javascript array? For example: var o = new Object(); o = "Adam"; o = "Eve";
5
12418
by: Gustavo Randich | last post by:
Hello, I'm writing an automatic SQL parser and translator from Informix to DB2. Now I'm faced with one of the most difficult things to translate, the "foreach execute procedure" functionality provided by Informix. This is the problem: the execution of the translated SQL leaves the rows in the temp table correctly but raises error SQL0480N. It's very simple to try it: ------------
9
9599
by: Frederik | last post by:
Hi all, I'm building a C# application that uses a M$ Acces database. In one of the queries I use something like the following: SELECT id FROM mytable WHERE id IN (20, 12, 21, 14) The result is fine, except that the order of the id's is not preserved. It seems to be ordered ascending. How can I keep the order I used as input?
0
1577
by: serge | last post by:
I have an XML file with an XSD file. When i am reading the XML file and putting its content into a DataSet I notice that the field that has a single space character is being converted to a field with no space character. DataSet ds = new DataSet(); ds.ReadXmlSchema(Path.ChangeExtension(fileNameC , ".xsd")); ds.ReadXml(fileNameC, XmlReadMode.ReadSchema);
8
3860
by: msnews.microsoft.com | last post by:
I want to redirect the user to a url outside of our website but I want it to preserve our application's window by opening a new window. We have a datagrid that has five hyperlink columns containing links to external sites. The hyperlink columns have the target="_blank" attribute so they preserve the existing window. This works OK except that the NavigateURL's are quite long due to the size of the query string and this makes the page slow. ...
2
6089
by: Lloyd Dupont | last post by:
I am "defining" an XML schema. In fact I'm not really writing any schema but I am writing an XML writer and reader for my data. It's all custom XML and I would like it to be XML tool friendly. I will have an element, lets call it <text/which will be in the document in great quantity and it should always have: xml:space="preserve" on.
0
1641
by: John | last post by:
Hi I have written a function to split a string into sub strings of a given fixed max length. This is useful for example in breaking a long message into multiple strings of up to 160 characters to be sent as individual SMS. I am posting the function here in case its useful for someone. Regards
0
9521
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
9333
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
8768
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
7324
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
6599
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
5214
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
5361
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3863
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
3
3442
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.