-
help with saving from a class to an xml file
hello
I'm looking for help with saving from a class to an XML file example- name of class is "Contacts" and I'm having a hard time with the coding for a "Public function Save" I can create the file but cant save to it what I've been trying
just rewrites the information that was already there. I need to pull the information from a class to a save button.
If anyone could help me with the coding it would be great.
Thank you!
-
hi
I actually didn't get your question. But I think that you want to update the Existing XML file with data. If that is the case
Take down my coding
Set xmldoc = CreateObject("MSXML.DomDocument")
If xmldoc.Load("F:\del\t5.xml") Then
Set root = xmldoc.documentElement
'Set e = IXMLDOMElement
'Set nd = IXMLDOMNode
'nd.BaseName = "india"
'nd.Text = "this is our country"
Set e = xmldoc.createElement("xml")
e.Text = "extensible markup language"
root.appendChild e
xmldoc.Save "F:\del\t5.xml"
MsgBox "over"
End If
-
If you want to serialise an object which is an instance of a class
XmlSerializer xs = new XmlSerializer(typeof(<NameSpace.ClassName>));
StreamWriter xw = new StreamWriter(<completefilenamewithpath>, false);
xs.Serialize(xw, <object>);
xw.Flush();
xw.Close();
Sri
Similar Threads
-
Replies: 11
Last Post: 08-23-2001, 04:47 PM
-
Replies: 2
Last Post: 01-03-2001, 10:40 AM
-
Replies: 5
Last Post: 12-09-2000, 11:50 PM
-
By CHRISTOS STAVRINOU in forum Database
Replies: 0
Last Post: 11-16-2000, 04:56 PM
-
Replies: 1
Last Post: 08-18-2000, 11:13 AM
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
Forum Rules
|
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL
|
Bookmarks