473,327 Members | 2,074 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,327 software developers and data experts.

XMLDataDocument question-- appending/removing nodes

Hi,

I'm porting a VB 6 app to .Net, and wanted to use an XMLDataDocument to
store information that had previously been kept in XML Recordsets.

Unfortunately, I'm not too familiar yet with .Net's XML Namespace and
was wondering if someone could help with something....in the VB 6
application, we would append two extra nodes to the XMLRecordset-- an error
message, and error number. Then, when it came time to reconstruct the
recordset we'd remove those nodes and go to it.

I'd like to do the same thing in .Net, but I'm not sure how to append
new nodes to existing XMLDataDocuments, nor how to search for and remove the
two nodes when the time comes. I've been reading over the msdn docs but was
hoping someone could point me in the right direction, or even paste a little
code on how to create and append nodes to an XMLDataDocument, and how to
search for particular nodes and remove them? Thanks very much.

-Jim
Nov 12 '05 #1
1 2074
There are at least a couple of ways. You can use the XML DOM methods, such
as InsertAfter:

objDoc.InsertAfter(objInsertedNode, objExistingNode)

or you can just set the InnerXml property of a node:

objNode.InnerXml = "<LongCode>" & strNewValue & "</LongCode><ShortCode>" _
& strShortCode & "</ShortCode>"

This example demonstrates both techniques:
http://www.daveandal.net/books/8900/.../edit-xml.aspx
Nov 12 '05 #2

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

Similar topics

12
by: Ole Noerskov | last post by:
The function below is supposed to remove all childnodes with a name that starts with "keywords" in "myform" in the window.opener. It works fine if there's one keyword node. But you have to run...
3
by: e-mid | last post by:
Here is an xml structure. i want to remove <a> nodes that do not have any child. How can i do that in csharp? <root> <a> <b/> </a> <a/> <a/> <a> <c/>
1
by: Swanand Mokashi | last post by:
Ok here is my XML structure : <Files> <File Name="One.txt"> <Client Name="test1"> <Errors> <OtherErrorIDs> <OtherErrorID>1</OtherErrorID> <OtherErrorID>2</OtherErrorID>...
2
by: Greg | last post by:
Hi. I have a rather large xml document (object) that can have one or more nodes with a certain attribute throughout (at ANY depth, not at the same level necessarily). I need to find this...
3
by: hharry | last post by:
Hi All, If I have the following xml: <Response> <AddressDetails> <Address> </Address> </AddressDetails> </Response>
17
by: Eric_Dexter | last post by:
def simplecsdtoorc(filename): file = open(filename,"r") alllines = file.read_until("</CsInstruments>") pattern1 = re.compile("</") orcfilename = filename + "orc" for line in alllines: if not...
2
by: runway27 | last post by:
my question is about removing the borders that are displayed by a select tag. presently i have a select tag that displays 8 values to which i have given a size of 5. code for this is = <select...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.