Novice: SecurityException on TableAdapter.Fill()?

G

Guest

Hello,

Thanks for reviewing my question. This is my first program with the new VS
2005 and I created a simple dialog with a datagrid connected to a new
database I created with VS as well.

this.sampleTableAdapter.Fill(this.sampleDataSet1.Teams);

Error Message:

System.Security.SecurityException was unhandled
Message="Request for the permission of type
'System.Data.SqlClient.SqlClientPermission

I clicked on the Action option to add the permission to my project and
restarted the debugging session but I still get the same error.

How do I solve this?

Many Thanks
Peter
 
G

Guest

Follow up,

My project is on a network drive and when I start VS it says that the
project location is not trusted.

Peter
 
?

=?iso-8859-1?Q?Patrik=20L=f6wendahl=20[C#=20MVP]?=

Hello Peter,

..NET has a security system called "Code Access Security" and that is what's
stopping you. All applications get a set of persmissions based on where it
executes from (and some other possible criterias). Your application has not
gotten this persmission.

Are you executing it from a shared folder on your network perhaps?

You can read more about CAS here: http://www.codeguru.com/csharp/csharp/cs_misc/security/article.php/c9253/
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top