VB.NET Window Application associates with SQL Server

I have a simple VB.NET Window Application, initially I program it WITHOUT having any database connection. It (the .exe) runs fine in my local PC and network shared.

When I add a database connection string to the program. A simple DSN-Less database connection string using ODBC Provider to SQL Server. Without any query, just merely try to connect to database. It runs fine in my local PC without any error BUT it returns security error when runs in network shared.

The security error is "The application attempted to perform an operation notallowed by the security policy. The operation required the SecurityException. To grant this application the required permission please contact your system administrator use the Microsoft .NET security policy administration tool. Security error"

*P/S: network shared and SQL Server are in the same network.

Your input is much appreciated. Thanks for your time.

Thanks,

UNet



Answer this question

VB.NET Window Application associates with SQL Server

  • Daniel_R

    It sounds like your application does not have enough trust to run as written... To fix that try increasing the Trust Level of it.

  • NateLondon

    Did this issue ever get resolved I am having the same issue--running a simple Windows application from a network drive and managing the Intranet Zone security. I found code that actually adds the Code Group to the Intranet_Zone code group in the security.config file. Again, it runs great on my computer but trying to run it from the network drive violates trust. Going to each users' computer is out of the question.
    Thanks

  • Electrum

    Thanks Brendan, your suggested solution works well. I will elaborate more of the flow requirement here. My application will be deployed into a network drive that will be access by dedicated users. Dedicated users are control by system admin.

    Appreciate if you could help me in the following enquiries:

    1. I have tried few online solutions for example, adjust the security level of LocalIntranet Zone to FullTrust (which I think is an unsecure method); create new code group by strong name condition type at machine level; or using Trust Assembly to make changes to this computer by adjust trust level for the assembly.
    All these methods enable me to access the .exe at network shared from my local computer without the security error. HOWEVER, may I get the solution which set up at network shared/server at one time in order to avoid the hessle of having to manually set up in each machine As there will be more than 100 users accessing it and more might come in the future. Yes, it has to be as window application NOT web application.

    2. All window applications that I am working will be deployed into network shared and accessed by authorized users to this network shared from their local computer. Knowing that adjust the trust level at machine level will do BUT not all user are allow to change their trust setting due to Runtime Security Policy is unable. Therefore, I m thinking of doing in such a way that any user who are allowed to access the application from network shared will have full trust right away. So again, back to 1st enquiry, are there any solution that can be set at network shared at once

    Appreciate your help and time.

    Thanks and Regards,

    UNet


  • ssteele00

    Hi

    Even i have a same issue. If you aware of what to do pls.. send me a mail to nlprabhu@gmail.com

    THanks

    Prabhu


  • VB.NET Window Application associates with SQL Server