.net error when querying database in VB and SQL

Posted on 2007-07-19
Last Modified: 2013-12-25
Hey Everyone,

I am querying certain tables in our database to retrieve info using DataGridView.  I am coding this in Studio 2005.  I am getting an error box popping up saying that

MicroSoft .NET Framework
"Application attempted to perform an operation not allowed by the security policy.  To grant this application the required permission, contact your system administrator, or use the Microsoft .NET Framework Configuration Tool."

Then a bit further down I get

"Request for the permission of type

I am thinking this is probably in my connection string configuration because the db user is the owner of the db, so the permission error is not there I do not believe.

Question by:edfreels
    LVL 8

    Expert Comment

    Go to Table>Property>Permission and check you have all the permission like insert update exec select permission for your user
    LVL 25

    Accepted Solution

    This is not a SQL permissions error, it is a code access permissions error.  
    Are you running the app from a shared drive?  Apps run from shared locations do not have permissions by default to run SqlClient code.  Eithe run the app from a local drive or give the app full trust using the .NET Configuration Tool.
    LVL 1

    Author Comment

    Thanks Guys,

    It was being stored in my documents which is on the network, I moved to my desktop and it works great.  

    Thanks again

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    How your wiki can always stay up-to-date

    Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
    - Increase transparency
    - Onboard new hires faster
    - Access from mobile/offline

    Today I had a very interesting conundrum that had to get solved quickly. Needless to say, it wasn't resolved quickly because when we needed it we were very rushed, but as soon as the conference call was over and I took a step back I saw the correct …
    This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
    Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
    Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

    779 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    14 Experts available now in Live!

    Get 1:1 Help Now