ragazzi solitamente lavoro con una dll che mi permette di compiere delle operazioni elementari su un db mysql
ovviamente su aruba di far girare questa dll non se ne parla
allora ho recuperato la funzioncina che mi fa gli insert e gli update
Function MyODBCExecute(ByVal ReqSQL As String, ByVal LaBase As String, ByVal Server As String, ByVal Password As String, ByVal User As String)
Dim MyConString As String = "DRIVER={MySQL ODBC 3.51 Driver};SERVER=" & Server & ";DATABASE=" & LaBase & ";UID=" & User & ";PASSWORD=" & Password & ";OPTION=3;"
Dim MyODBCConnexion As New OdbcConnection(MyConString)
Try
Dim MyCommand As New OdbcCommand()
Dim MyDataReader As OdbcDataReader
MyODBCConnexion.Open()
MyCommand.Connection = MyODBCConnexion
MyCommand.CommandText = ReqSQL
MyCommand.ExecuteNonQuery()
MyODBCConnexion.ReleaseObjectPool()
MyODBCConnexion.Close()
MyODBCConnexion = Nothing
Catch MyOdbcException As OdbcException
' HttpContext.Current.Response.Write(MyOdbcException .ToString)
Catch MyException As Exception
' HttpContext.Current.Response.Write(MyException.ToS tring)
End Try
End Function
nella sub che gestisce l'inserimento dei dati
la richiamo cosi
dim sqlInsert as string = "INSERT INTO bla bla bla"
MyODBCExecute(SQLInsert, "Dato1", "Dato2", "Dato3", "Dato4")
ricevo questo errore
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.
System.Security.SecurityException: That assembly does not allow partially trusted callers.
in prossimità della chiusura della function
End Function
qesto è lo stesso errore che ottengo tentando di utilizzare la mia dll
come fare ?

Rispondi quotando