I have made a working script including mysql net connection thats working perfekt running inside tenscriptning but when I run it from HS I got error with system.data
settings.ini
Error Message
Here it the code (ConnectionState) that start the error
Any suggestions?
settings.ini
PHP Code:
ScriptingReferences=HSPI_SIP;c:\ithemmet\hspi_sip.dll,System.Drawing;System.Drawing.dll,System.XML;System.XML.dll,System.Web;System.Web.dll,System.Data;system.Data.dll,MySql.Data.MySqlClient;C:\Program Files (x86)\MySQL\MySQL Connector Net 6.4.3\Assemblies\v4.0\MySql.Data.dll
PHP Code:
Imports System.Xml
Imports System.Text
Imports System.Net
Imports System.IO
Imports System.Data
Imports System.Data.Odbc
Imports MySql.Data.MySqlClient
PHP Code:
2011-10-29 01:37:51 - Error - Scripting runtime error: System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. --->
System.IO.FileNotFoundException: Could not load file or assembly 'System.Data, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' or one of its dependencies.
The system cannot find the file specified.File name: 'System.Data, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' at scriptcode12.scriptcode12.OpenDatabase() at scriptcode12.scriptcode12.Main(Object parm)WRN: Assembly binding logging is turned OFF.To enable assembly bind failure logging, set the registry value [HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD) to 1.Note: There is some performance penalty associated with assembly bind failure logging.To turn this feature off, remove the registry value [HKLM\Software\Microsoft\Fusion!EnableLog]. --- End of inner exception stack trace --- at System.RuntimeMethodHandle._InvokeMethodFast(Object target, Object[] arguments, SignatureStruct& sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner) at System.RuntimeMethodHandle.InvokeMethodFast(Object target, Object[] arguments, Signature sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner) at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisibilityChecks) at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) at System.Reflection.MethodBase.Invoke(Object obj, Object[] parameters) at Scheduler.VsaScriptHost.Invoke(String ModuleName, String MethodName, Object[] Arguments)
PHP Code:
Public Sub OpenDatabase()
SQLConnection.ConnectionString = serverstring
Try
If SQLConnection.State = ConnectionState.Closed Then
SQLConnection.Open()
hs.WriteLog("Database open", "Success")
Else
SQLConnection.Close()
hs.WriteLog("Database open", "Success")
End If
Catch ex As Exception
hs.WriteLog("Database Error", ex.ToString)
End Try
End Sub
Comment