• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 557
  • Last Modified:

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

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
GaryHoff
Asked:
GaryHoff
1 Solution
 
AlexFMCommented:
string filePath = "C:\\tmp";

I think this should be some XML file, like:

string filePath = "C:\\tmp\\data.xml";
0
 
GaryHoffAuthor Commented:
That was it.  I thought the dataSource name was appended to the path - not so.
The path and filename are required.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: Amazon Web Services - Basic

Are you thinking about creating an Amazon Web Services account for your business? Not sure where to start? In this course you’ll get an overview of the history of AWS and take a tour of their user interface.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now