Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Web Services > Read\Update XML file

Reply
Thread Tools

Read\Update XML file

 
 
siaj
Guest
Posts: n/a
 
      02-17-2005
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.xm l"))
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,
siaj
 
Reply With Quote
 
 
 
 
Lionel LASKE
Guest
Posts: n/a
 
      02-18-2005

Check user permission on your directory or change your virtual directory
security permission.
By default, the anonymous ASPNET user had no write access on the virtual
directory.

Lionel.

"siaj" <> a écrit dans le message de news:
33549D33-FCF7-43A1-BDBC-...
> 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.xm l"))
> 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,
> siaj



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
including one XML file in another XML file Johan XML 20 02-27-2007 04:29 PM
Problem to insert an XML-element by XSLT-converting from one XML-file into another XML-file jkflens XML 2 05-30-2006 09:41 AM
Different results parsing a XML file with XML::Simple (XML::Sax vs. XML::Parser) Erik Wasser Perl Misc 5 03-05-2006 10:09 PM
UPnP xml file to WSDL xml file Robert S XML 1 10-14-2005 09:32 PM
tool to validate xml file against custom XML Schema file Leona XML 9 11-01-2004 09:51 AM



Advertisments