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
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