473,386 Members | 1,736 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Read\update xml file

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
Nov 19 '05 #1
2 1355
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.

Nov 19 '05 #2
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.

Nov 19 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: matt | last post by:
I have compiled some code, some written by me, some compiled from various sources online, and basically i've got a very simple flat file photo gallery. An upload form, to upload the photos and give...
5
by: Dave Smithz | last post by:
Hi There, I have a PHP script that sends an email with attachment and works great when provided the path to the file to send. However this file needs to be on the same server as the script. ...
7
by: Joseph | last post by:
Hi, I'm having bit of questions on recursive pointer. I have following code that supports upto 8K files but when i do a file like 12K i get a segment fault. I Know it is in this line of code. ...
3
by: StGo | last post by:
How can i read/write file's custom attributs(like subject,author...) in C#??? Thanks :))
0
by: Lokkju | last post by:
I am pretty much lost here - I am trying to create a managed c++ wrapper for this dll, so that I can use it from c#/vb.net, however, it does not conform to any standard style of coding I have seen....
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.