Sloan
See my answer to Nicholas, this isnt an ASP Program, is winforms
Yo can see my code
This is an environment problem
You can see on the stacktrace:
StackTrace " at System.Security.CodeAccessSecurityEngine.Check(Obj ect
demand, StackCrawlMark& stackMark, Boolean isPermSet)\r\n at
System.Security.PermissionSet.Demand()\r\n at
System.Data.Common.DbConnectionOptions.DemandPermi ssion()\r\n at
System.Data.OleDb.OleDbConnection.PermissionDemand ()\r\n at
System.Data.OleDb.OleDbConnectionFactory.Permissio nDemand(DbConnection
outerConnection)\r\n at
System.Data.ProviderBase.DbConnectionClosed.OpenCo nnection(DbConnection
outerConnection, DbConnectionFactory connectionFactory)\r\n at
System.Data.OleDb.OleDbConnection.Open()\r\n at
ProcessExcelFile.Form1.GetDataFromExcelFile(String File_name)"
Understand?
Regards
Abel
"sloan" wrote:
I'd concur.
Permissions on the file, usually because of an asp.net environment.
Also, you have to be very anal with the connection string with excel. Every
space and ; matters.
"Abel" <Ab**@discussions.microsoft.comwrote in message
news:89**********************************@microsof t.com...
Hi
I try to execute an sample how to read and write excel sheets using OleDb
When opens the connection, the objConn.Open gave me this error:
"Request for the permission of type 'System.Data.OleDb.OleDbPermission,
System.Data, Version=2.0.0.0, Culture=neutral,
PublicKeyToken=b77a5c561934e089' failed."
And appears the following message:
System.Exception {System.Security.SecurityException}
Any idea to solve this error?
I work with VS 2005, using C#
TIA
Abel