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

Home Posts Topics Members FAQ

system error when writitng to xml....

i got "system error" when saving to xml file.
i am using checkbox1 control to xml. when user clicked checkbox and set
to true and press btnOk to conform and save it to xml

rw.WriteConfigI nfo("User Modes", chkInvisible.Te xt,
chkInvisible.Ch ecked, "PirateChat.xml ")

the error occured in hightleighted in below :.......

Public Function WriteConfigInfo (ByVal aSection As String, ByVal aKey As
String, ByVal aValue As String) As Boolean
Dim node1 As XmlNode
Dim node2 As XmlNode
If aKey = "" Then
' find the section, remove all its keys and remove
the section
node1 =
(Doc.DocumentEl ement).SelectSi ngleNode("/configuration/" & aSection)
' if no such section, return True
If node1 Is Nothing Then Return True
' remove all its children
node1.RemoveAll ()
' select its parent ("configuration ")
node2 =
(Doc.DocumentEl ement).SelectSi ngleNode("confi guration")
' remove the section
node2.RemoveChi ld(node1)
ElseIf aValue = "" Then
' find the section of this key
node1 =
(Doc.DocumentEl ement).SelectSi ngleNode("/configuration/" & aSection)
' return if the section doesn't exist
If node1 Is Nothing Then Return True
' find the key
node2 =
(Doc.DocumentEl ement).SelectSi ngleNode("/configuration/" & aSection &
"/" & aKey)
' return true if the key doesn't exist
If node2 Is Nothing Then Return True
' remove the key
If node1.RemoveChi ld(node2) Is Nothing Then Return False
Else
' Both the Key and the Value are filled
' Find the key
node1 =
(Doc.DocumentEl ement).SelectSi ngleNode("/configuration/" & aSection &
"/" & aKey) <======= error occured in here.
If node1 Is Nothing Then
' The key doesn't exist: find the section
node2 =
(Doc.DocumentEl ement).SelectSi ngleNode("/configuration/" & aSection)
If node2 Is Nothing Then
' Create the section first
Dim e As Xml.XmlElement =
Doc.CreateEleme nt(aSection)
' Add the new node at the end of the
children of ("configuration ")
node2 = Doc.DocumentEle ment.AppendChil d(e)
' return false if failure
If node2 Is Nothing Then Return False
' now create key and value
e = Doc.CreateEleme nt(aKey)
e.InnerText = aValue
' Return False if failure
If (node2.AppendCh ild(e)) Is Nothing Then
Return False
Else
' Create the key and put the value
Dim e As Xml.XmlElement =
Doc.CreateEleme nt(aKey)
e.InnerText = aValue
node2.AppendChi ld(e)
End If
Else
' Key exists: set its Value
node1.InnerText = aValue
End If
End If
' Save the document
Doc.Save(FileNa me)
End Function


my output look like this:
<configuratio n>
-
<PirateChat>
<RealName>Pirat eChat XP Prof 2004 version 1.0 </RealName>
<Email>su***@to yota.com</Email>
<Nick>doremaf a</Nick>
<AltNick>djanjo </AltNick>
<Pswrd>supra</Pswrd>
<Network>Undern et</Network>
<Server>eu.unde rnet.org</Server>
</PirateChat>
</configuration>

regards,

Nov 12 '05 #1
0 1306

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

Similar topics

9
4967
by: Penn Markham | last post by:
Hello all, I am writing a script where I need to use the system() function to call htpasswd. I can do this just fine on the command line...works great (see attached file, test.php). When my webserver runs that part of the script (see attached file, snippet.php), though, it doesn't go through. I don't get an error message or anything...it just returns a "1" (whereas it should return a "0") as far as I can tell. I have read the PHP...
1
17142
by: Martin Honnen | last post by:
With both .NET 1.0 and 1.1 I have found the following strange behaviour where System.Xml.XmlDocument.LoadXml doesn't throw an error when parsing a text node with a character reference to an invalid characters like &#x1;. Using the CreateTextNode method I create a text node containing "\u0001a" (C# string literal notation). As far as I understand the DOM allows that and an implementation is not required to throw an error. When OuterXml is...
4
2665
by: DOTNET | last post by:
Hi, Anybody help me regarding this error: I am assigning the values to the session variables when the button is clicked and passing these session variables to the next page and when I am printing these session variables they are printing. After that I am assigning these things in hidden object and in the form submit action I am receiving these hidden values like the following:
5
9657
by: petro | last post by:
Hello all, My asp.net web application works on my machine but I get the following error on our test web server, There is only one oracle home on the test server. Does anyone know how to resolve this error? Oracle error occurred, but error message could not be retrieved from Oracle. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the...
3
3235
by: Sarah | last post by:
I have a function residing in a module that is doing some file copy and database query operations. This function is called from a regular form under a System.Windows.Forms.Timer control. The problem is that sometimes it gives an error - even when it is doing the same exact operations. It may fail on the 20th tick event or the 100th. The file and data has no changes - so, it is doing the same operations repeatedly. I'm wondering if anyone...
5
19604
by: Stacey Levine | last post by:
I have a webservice that I wanted to return an ArrayList..Well the service compiles and runs when I have the output defined as ArrayList, but the WSDL defines the output as an Object so I was having a problem in the calling program. I searched online and found suggestions that I return an Array instead so I modified my code (below) to return an Array instead of an ArrayList. Now I get the message when I try to run just my webservice...
2
3502
by: Ryan | last post by:
Hi, I receive an access denied error (see below) when attempting to send an email with BodyFormat=MailFormat.Html from an asp.net page. Exactly the same code works fine in a console application, and also succeeds from the asp.net page with BodyFormat=MailFormat.Text. I've recently upgraded from W2K SP4 to WinXP SP2 and am using .Net Framework v1.1 SP1. The code worked fine under W2K SP4.
0
4360
by: Jim Duffie | last post by:
Hi, I am trying to build a simple websire using the above in Visual Web Developer. When finished I have build the website and it works fine locally but when I FTP it to the server I am getting a parse error. Should I be uploading a DLL as well (I can't see one in directory)? The error is :- Parser Error Message: Could not load type System.Web.UI.WebControls.Menu from assembly System.Web, Version=1.0.5000.0, Culture=neutral,...
0
9716
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
9595
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
10354
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
10101
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
7643
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
6870
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
5536
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...
1
4314
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
3005
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.