Connecting to mySql from .Net

Collapse

Unconfigured Ad Widget

Collapse
This topic is closed.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts
  • ralph eddy
    Junior Member
    • Dec 2006
    • 1

    Connecting to mySql from .Net

    What is the best way for me to connect to mySql connect from my .Net application?

    I am using MySql.Data.dll.

    When I try and make a database connection I get this warning:
    System.Security.SecurityException: That assembly does not allow partially trusted callers.

    I would appreciate any recommendations and other Best Practices.

    Thanks,
  • Jason
    Administrator
    • Sep 2004
    • 95

    #2
    Check various mysql connection strings at http://www.connectionstrings.com/?carrier=mysql
    Jason
    ---------
    Technical Support Group
    AccuWebHosting.Com
    Windows Website Hosting
    Linux Website Hosting

    Comment

    • Nici
      Member
      • Sep 2004
      • 31

      #3
      Ralph,

      It seems that your hosting provider has partial trust enabled on the server for ASP.NET, which is good as far security is concerned. So, i would recommend you to write down your code acceptable in partial trust environment.

      Make sure that the MySQL provider is not strongly signed (which would give an implicit LinkDemand for FullTrust on every public and protected method of every publicly visible class), as it refuses to be called by partially trusted code. In this case, you should recompile the MySql.Data.dll without strongly signing it.

      Let me know if that works for you.

      Thanks,

      Comment

      Working...
      X