Anyone doing this? I can't get MySql Connector/Net to work unless i set at full trust.

Output is: Exception Details: System.Security.SecurityException: Security error.

Output also hints about adding Debug="true" in the web.config, which don't have any impact at all.

This is what i have done so far;

Installed connector with installer from

Added assembly to machine.config with:

<add assembly="MySql.Data, Version=, Culture=neutral, PublicKeyToken=c5687fc88969c44d"/>
which made it work in full trust.

After that changed to medium and no go.

This is the source i tested:
<%@ Page Language="VB" debug="true" %>
<%@ Import Namespace = "System.Data" %>
<%@ Import Namespace = "MySql.Data.MySqlClient" %>
<script language="VB" runat="server">

Sub Page_Load(sender As Object, e As EventArgs)

    Dim myConnection  As MySqlConnection
    Dim myDataAdapter As MySqlDataAdapter
    Dim myDataSet     As DataSet

    Dim strSQL        As String
    Dim iRecordCount  As Integer

    myConnection = New MySqlConnection("server=localhost; user id=UID; password=PW; database=DB; pooling=false;")

    strSQL = "SELECT * FROM mytable;"

    myDataAdapter = New MySqlDataAdapter(strSQL, myConnection)
    myDataSet = New Dataset()
    myDataAdapter.Fill(myDataSet, "mytable")

    MySQLDataGrid.DataSource = myDataSet

End Sub


<title>Simple MySQL Database Query</title>

<form runat="server">

<asp:DataGrid id="MySQLDataGrid" runat="server" />