ok con la master page da un errore e se scrivo una pagina adhoc
sola soletta senza altri impicci, in pratica una paginetta di test,
solita storia quindi suppongo che la master page sia innocente
ma continua a sfuggirmi il problema
questa è la pagina di test:
Codice PHP:
<%@ Page Language="C#" LCID="1040" AutoEventWireup="true" %>
<%@ Import Namespace = "System" %>
<%@ Import Namespace = "System.IO" %>
<%@ Import Namespace = "System.Data" %>
<%@ Import Namespace = "MySql.Data" %>
<%@ Import Namespace = "MySql.Data.MySqlClient" %>
<script Language="C#" runat="server">
void Page_Load(object sender, EventArgs e)
{
string SQL = "SELECT * FROM `news` WHERE OnLine=1 ORDER BY `Data` DESC;";
string connString = "Data Source=hostingmysql01.register.it; Database=(mioDB); User ID=(miouserID); password=(la mia password);";
MySqlConnection MySqlConn = new MySqlConnection(connString);
MySqlConn.Open();
MySqlCommand MySqlCmd = new MySqlCommand(SQL, MySqlConn);
MySqlDataReader MySqlDR = MySqlCmd.ExecuteReader();
if (MySqlDR.HasRows)
{
while (MySqlDR.Read())
{
output.Text += "<" + MySqlDR["Data"] + ">[b]" + MySqlDR["Oggetto"] + "[/b]"[i]" + MySqlDR["DaChi"] + "[/i]"
" + MySqlDR["body"] + "
<hr>";
} // while (MySqlDR.Read())
} // if (MySqlDR.HasRows)
MySqlDR.Close();
MySqlConn.Close();
} // void Page_Load(object sender, EventArgs e)
</script>
<html>
<head runat="server">
<title>Test MySql</title>
</head>
<body>
Prova recupero dati dal DB.
<asp:Label id="output" runat="server"/>
</body>
</html>
L'errore è il solito ma lo riposto ancora:
codice:
Server Error in '/' Application.
Security Exception
Description: The application attempted to perform an operation not allowed by the security policy. To grant this application the required permission please contact your system administrator or change the application's trust level in the configuration file.
Exception Details: System.Security.SecurityException: That assembly does not allow partially trusted callers.
Source Error:
Line 29: MySqlDR.Close();
Line 30: MySqlConn.Close();
Line 31: } // void Page_Load(object sender, EventArgs e)
Line 32:
Line 33:
Source File: \\wagner\wwwroot$\deepabyss.org\News\default.aspx Line: 31
Nessuno sa perchè????