?
Solved

.net error when querying database in VB and SQL

Posted on 2007-07-19
3
Medium Priority
?
211 Views
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
"System.Data.SqlClient.SqlClientPremission,SystemData,Version=2.0.0.0,Culture=neutral,PublicKeyToken=b77a5c561934e089"

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.

Thanks.
0
Comment
Question by:edfreels
3 Comments
 
LVL 8

Expert Comment

by:sabeesh
ID: 19525271
Go to Table>Property>Permission and check you have all the permission like insert update exec select permission for your user
0
 
LVL 25

Accepted Solution

by:
dstanley9 earned 500 total points
ID: 19525331
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.
0
 
LVL 1

Author Comment

by:edfreels
ID: 19525690
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
0

Featured Post

Get your Conversational Ransomware Defense e‑book

This e-book gives you an insight into the ransomware threat and reviews the fundamentals of top-notch ransomware preparedness and recovery. To help you protect yourself and your organization. The initial infection may be inevitable, so the best protection is to be fully prepared.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
With User Account Control (UAC) enabled in Windows 7, one needs to open an elevated Command Prompt in order to run scripts under administrative privileges. Although the elevated Command Prompt accomplishes the task, the question How to run as script…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
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…
Suggested Courses
Course of the Month16 days, 21 hours left to enroll

864 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