Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Update XML File

Status
Not open for further replies.

mousematt

MIS
Feb 5, 2001
102
GB
Hi

I'm trying to update an xml file I'm not sure if i'm going in the right direction. I'm using the below code to add data to an xml file but would like to try and update a record and write it back. Also I would like to be able to delete a record. Can anyone help.

Sub GalleryXMLWrite(title as String, uid As String, lid As String)
Dim dsGallery As DataSet = New DataSet()
dsGallery.ReadXml(Server.MapPath("\assets\xml\gallery.xml"))
Dim GalleryEntry As DataRow = dsGallery.Tables(0).NewRow()

GalleryEntry("g_title") = title
GalleryEntry("g_id") = 12
GalleryEntry("g_u_id") = uid
GalleryEntry("g_l_id") = lid
dsGallery.Tables(0).Rows.Add(GalleryEntry)
dsGallery.WriteXml(Server.MapPath("\assets\xml\gallery.xml"))')
End Sub
 
Consider using the native XMLDocument object for working directly on XML. It has a very nice hierarchical programming model that just feels right working w/ XML:


-p

penny.gif
penny.gif

The answer to getting answered -- faq855-2992
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top