I have created an application which populates a .csv file on the data-grid.When the user
clicks a button a dialog box opens and the user selects a .csv file and opens it.

The connection string that I've used is;
"Provider=Microsoft.Jet.OLEDB.4.0;Data Source='"+filename+"'ExtendedProperties=text;HDR=Yes;FMT=Delimited";

When I run the program the error that I get is:
Request for the permission of type 'System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.

Please help.

try to run your application as administrator and feed me back!

try to run your application as administrator and feed me back!

Yes I ran the application as you adviced me to, but it is giving me a new error,
regarding connectionstring what should be the connection string to populate a .csv file
in a datagrid?

You are not by chance trying to run the application from a network share or mapped drive ?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.