ADO.NET Permission failed problem - Network Drives!

I spent half an hour trying to get a basic ADO.NET + C# database query example to work.  I would get the error below:

Exception System.Security.SecurityException was thrown in debugee:
Request for the permission of type 'System.Data.SqlClient.SqlClientPermission, System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.

OpenConnection()
Open()
Main() - z:\SharpDevelop Projects\test4\Main.cs:21,13


The solution?  Permissions!  A network mapped drive is NOT the same as a local fixed drive -- you must fiddle with the permissions to allow a "remote" application connect to databases!
See: http://groups.google.com/group/microsoft.public.dotnet.languages.csharp/browse_thread/thread/5b99831e0cdcd2d/849292df64ae49b9?lnk=st&q=Request+for+the+permission+of+type+'System.Data.SqlClient.SqlClientPermission%2C+System.Data%2C+Version%3D2.0.0.0%2C+Culture%3Dneutral%2C+PublicKeyToken%3Db77a5c561934e089'+failed.&rnum=2#849292df64ae49b9


As an aside, this is a great tutorial:
http://www.csharp-station.com/Tutorials/AdoDotNet/Lesson02.aspx

Fake Tags: SharpDevelop, C#, dotnet, C Sharp
Related Scribbles:
  • Programming
  • C# (Csharp) Links and Resources
  • .net AKA dotnet notes links and resources


  • ID: 747
    Author:
    leonard
    Date Updated:
    2006-02-15 11:30:36
    Date Created:
    2006-02-15 11:30:36

    Edit

    Comments?
     >> Leonard Chan's Homepage  >> Scribble Web  >> ADO.NET Permission failed problem - Network Drives!
    leonard.lotus-land.ca is hosted by Perceptus Solutions Inc.