Reading/updating XML file

G

Guest

Hi..
I m just trying to learn using XML file as a datastore.

I am reading a dataset from a XML file and then trying to update the XML
file with some changes in the dataset.
My code is as follwoing.

Private Sub ReadUpdateData()
Dim dsUser As New DataSet
dsUser.ReadXml(Server.MapPath("Datafiles\Users.xml"))
DataGrid1.DataSource = dsUser
DataGrid1.DataBind() 'Read data

dsUser.Tables(0).Rows(0).Item(1) = "xyz" 'changed value
dsUser.WriteXml(Server.MapPath("Datafiles\Users.xml"))
End Sub

The Above code gives me error as Access to the path
"C:\...\Datafiles\Users.xml" is denied


any help will be highly aprreciated.

Cheers,
Jai
 
G

Guest

No I dont Have the Xml file open anywhere .Althufh just fyi its a part of my
project.

Thanks
 
M

Mr Newbie

OK, well this is normally caused by your code breaking and when you try to
run it again, there is a handle still open.

Reboot your PC and then step through the code to find the error.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top