473,804 Members | 3,057 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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\User s.xml"))
DataGrid1.DataS ource = dsUser
DataGrid1.DataB ind() 'Read data

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

The Above code gives me error as Access to the path
"C:\...\Datafil es\Users.xml" is denied
any help will be highly aprreciated.

Cheers,
siaj
Nov 19 '05 #1
2 1372
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\User s.xml"))
DataGrid1.DataS ource = dsUser
DataGrid1.DataB ind() 'Read data

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

The Above code gives me error as Access to the path
"C:\...\Datafil es\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\User s.xml"))
DataGrid1.DataS ource = dsUser
DataGrid1.DataB ind() 'Read data

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

The Above code gives me error as Access to the path
"C:\...\Datafil es\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
3932
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 them a caption, storing the caption and filename in a text file. It's a bit buggy when removing the photos and captions from the file, and also in displaying them on the delete page. you can see it in action at www.4am.com.au/gallery/upload.php...
5
5470
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. I want to develop a webpage where people can send attachments that are stored on their local PC.
7
3541
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. How do i make the last pointer in the indirect sector that has another level of indirect pointer, and be defined recursively to support infinite large files? -code-
3
26272
by: StGo | last post by:
How can i read/write file's custom attributs(like subject,author...) in C#??? Thanks :))
0
3945
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. It is almost like it is trying to implement it's own COM interfaces... below is the header, and a link to the dll+code: Zip file with header, example, and DLL:...
0
9706
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10337
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
10082
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
6854
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5525
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5654
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4301
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3822
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2995
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.