Hello all,
I've a C# application connecting to a SQL Server 2005 DataBase and it all works well in development ambient. I'm developing with Visual Studio 2005 and i can connect to the DataBase with no problem.
The problem is: when i try to run the application directly from the exe file, every time there is a connection to the same database (and with exactly the same connection string) that i connected with no problem in development ambient, i get the following error: "Request for the permission of type 'System.Data.SQLClientPermission, System.Data, Version=2.0.0.0, Culture=Neutral, PublicKeyToken=b77a5c561934e089' failed.
Why? If i can do it in Visual Studio, and in if i can connect to the DataBase with no problem with SQL Server Managment Studio?
TIA,
Joaquim
Joaquim CorreiaPosted Feb 28, 2008, 5:13 AM
Thank you
Joaquim
Vijaya KadiyalaPosted Feb 27, 2008, 11:53 AM
Hi,
This problem is due to the permissions requirements of your program. Is the program being run under a different group that does not have access to the sqlclient.
A few things to try:
1. Check to make sure that the account in which the sqlclient is being run under is a domain user and is the same domain as all others trying to access it.
2a. Navigate to the Microsoft .NET Framework 2.0 Configuration under the Administrative tools.
2b. Click runtime Assembly options and then click Evaluate Assembly in the window to the right.
2c. Navigate to your executeable and make sure that it has unrestricted permission.
Thanks -- Vj
http://dotnetvj.blogspot.com