Announcement

Collapse
No announcement yet.

ConnectionState and System.Data Namespace [Problem]

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    ConnectionState and System.Data Namespace [Problem]

    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
    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 
    Error Message
    PHP Code:
    2011-10-29 01:37:51  Error Scripting runtime error:  System.Reflection.TargetInvocationExceptionException has been thrown  by the target of an invocation. ---> 
    System.IO.FileNotFoundExceptionCould 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)WRNAssembly binding logging  is turned OFF.To enable assembly bind failure loggingset the registry  value [HKLM\Software\Microsoft\Fusion!EnableLog] (DWORDto 1.Note:  There is some performance penalty associated with assembly bind failure  logging.To turn this feature offremove the registry value  [HKLM\Software\Microsoft\Fusion!EnableLog].   --- End of inner exception  stack trace ---   at  System.RuntimeMethodHandle._InvokeMethodFast(Object targetObject[]  argumentsSignatureStructsigMethodAttributes methodAttributes,  RuntimeTypeHandle typeOwner)   at  System.RuntimeMethodHandle.InvokeMethodFast(Object targetObject[]  argumentsSignature sigMethodAttributes methodAttributes,  RuntimeTypeHandle typeOwner)   at  System.Reflection.RuntimeMethodInfo.Invoke(Object objBindingFlags  invokeAttrBinder binderObject[] parametersCultureInfo culture,  Boolean skipVisibilityChecks)   at  System.Reflection.RuntimeMethodInfo.Invoke(Object objBindingFlags  invokeAttrBinder binderObject[] parametersCultureInfo culture)    at System.Reflection.MethodBase.Invoke(Object objObject[] parameters)    at Scheduler.VsaScriptHost.Invoke(String ModuleNameString MethodName,  Object[] Arguments
    Here it the code (ConnectionState) that start the error
    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 
    Any suggestions?
    Please excuse any spelling and grammatical errors I may make.
    --
    Tasker Plugin / Speech Droid
    Tonlof | Sweden

    #2
    i think it is possible to connect net 4 applications with net 2 homeseer VIA tenscripting but not directly your application which is 4, in homeseer which is net 2

    Comment

    Working...
    X