I was recently moved to a server that supports ASP.NET 2.0, and I'm trying to connect to my mysql databases with ASP.NET 2.0. I was able to do it quite easily with .NET 1.1, but it's no longer working since the switch.
Take this script for example:
When I run this script, it gives me the following error on the "MySqlConnection conn ..." line:
"System.Security.SecurityException: That assembly does not allow partially trusted callers."
I copied the latest MySQL Connector/Net to my /bin folder before running. Can anyone tell me what I'm doing wrong and/or offer a solution for connecting to MySQL from Jodo+ASP.NET 2.0?
Take this script for example:
<%@ Page Language="C#" Debug="true" %>
<%@ Import Namespace="MySql.Data.MySqlClient" %>
<script runat="server">
MySqlConnection conn = new MySqlConnection("server=localhost; user id=myuser; password=mypwd; database=usrname_dbname");
</script>
<html><body>
Hello World!
</body></html>
<%@ Import Namespace="MySql.Data.MySqlClient" %>
<script runat="server">
MySqlConnection conn = new MySqlConnection("server=localhost; user id=myuser; password=mypwd; database=usrname_dbname");
</script>
<html><body>
Hello World!
</body></html>
When I run this script, it gives me the following error on the "MySqlConnection conn ..." line:
"System.Security.SecurityException: That assembly does not allow partially trusted callers."
I copied the latest MySQL Connector/Net to my /bin folder before running. Can anyone tell me what I'm doing wrong and/or offer a solution for connecting to MySQL from Jodo+ASP.NET 2.0?