Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Read\update xml file

Reply
Thread Tools

Read\update xml file

 
 
=?Utf-8?B?c2lhag==?=
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
 
 
 
 
ashish
Guest
Posts: n/a
 
      02-17-2005
siaj wrote:

> 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

make sure your xml file is having read persmission for aspnet user.

 
Reply With Quote
 
 
 
 
=?Utf-8?B?c2lhag==?=
Guest
Posts: n/a
 
      02-17-2005
thanks Ashish...
u were right ..It worked ..
cheers,
siaj

"ashish" wrote:

> siaj wrote:
>
> > 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

> make sure your xml file is having read persmission for aspnet user.
>
>

 
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
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57