Solved

Access to the path "C:\tmp" is denied running Visual C# Walkthrough: Reading XML Data into a Dataset

Posted on 2006-07-23
2
525 Views
Last Modified: 2008-02-01
I am running the Visual C# .NET sample program - Visual C# Walkthrough: Reading XML Data into a Dataset, and getting the following error:
       An unhandled exception of type 'System.UnauthorizedAccessException' occurred in system.xml.dll
       Additional information: Access to the path "C:\tmp" is denied.
On the code lines:
      string filePath = "C:\\tmp";
      dsAuthors.ReadXml(filePath);

I have checked the attributes for C:\tmp  using command "attrib" and read only is not on.
I am logged in as Administrator.

What else should I look at?

                  
0
Comment
Question by:GaryHoff
2 Comments
 
LVL 48

Accepted Solution

by:
AlexFM earned 250 total points
ID: 17163114
string filePath = "C:\\tmp";

I think this should be some XML file, like:

string filePath = "C:\\tmp\\data.xml";
0
 
LVL 1

Author Comment

by:GaryHoff
ID: 17164502
That was it.  I thought the dataSource name was appended to the path - not so.
The path and filename are required.
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

The following diagram presents a diamond class hierarchy: As depicted, diamond inheritance denotes when two classes (e.g., CDerived1 and CDerived2), separately extending a common base class (e.g., CBase), are sub classed simultaneously by a fourt…
In Easy String Encryption Using CryptoAPI in C++ (http://www.experts-exchange.com/viewArticle.jsp?aid=1193) I described how to encrypt text and recommended that the encrypted text be stored as a series of hexadecimal digits -- because cyphertext may…
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

744 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now