Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Mixed mode assembly issue
Message
De
01/04/2015 13:15:28
 
 
À
01/04/2015 11:39:46
Information générale
Forum:
ASP.NET
Catégorie:
Autre
Versions des environnements
Environment:
VB 9.0
OS:
Windows 8.1
Network:
Windows 2008 Server
Database:
MS SQL Server
Application:
Web
Divers
Thread ID:
01617618
Message ID:
01617644
Vues:
21
>>Although your projects may all target 4.0 it's possible that one (or more) may be referencing components using an older version.
>>Building the projects individually might give you a clue.
>>Probably not worth trying to track them down tho........
>
>Thanks
>
>The method which triggered it was:
>
>
>    ' Execute a SQL script
>    ' expC1 Script
>    ' expL1 Execute with results
>    Public Function ExecuteSQLScript(ByVal tcScript As String, _
>     Optional ByVal tlExecuteWithResult As Boolean = False) As Boolean
>        Dim lcConnectionString As String = ""
>        Dim lcScript As String = ""
>        Dim llSuccess As Boolean = False
>        Dim lnDateNow As Double = 0
>        Dim lnDateNow2 As Double = 0
>        Dim lnElapse As Double = 0
>        Dim loServer As Server = Nothing
>        Dim loServerConnection As ServerConnection = Nothing
>        Dim loSQLConnection As SqlConnection = Nothing
>
>        ' Reset the values
>        cScriptMessage = ""
>        nDuration = 0
>
>        ' Start time
>        lnDateNow = Date.Now.Ticks
>
>        ' Initialize the data object
>        If Not InitializeDataObject("") Then
>            Return False
>        End If
>
>        Try
>
>            ' Get the proper definition as per the current scope
>            If oProcess Is Nothing Then
>                lcConnectionString = oApp.aConnection(nConnectionString, 1)
>            Else
>                lcConnectionString = oProcess.aConnection(nConnectionString, 1)
>            End If
>
>            ' Initialize the SMO object
>            loSQLConnection = New SqlConnection(lcConnectionString)
>            loServerConnection = New ServerConnection(loSQLConnection)
>            loServer = New Server(loServerConnection)
>
>            ' Add the event handler
>            AddHandler loSQLConnection.InfoMessage, New SqlInfoMessageEventHandler(AddressOf ScriptMessage)
>
>            ' In SQL Server, we have to turn off ANSI Warnings as we will have an error
>            ' if a field value is greater than the field length
>            lcScript = lcScript + "SET ANSI_WARNINGS OFF" + oApp.cCR
>
>            ' Get the script
>            lcScript = lcScript + tcScript
>
>            ' We execute with result
>            If tlExecuteWithResult Then
>                oDataSet = New DataSet
>
>                ' Execute the script
>                oDataSet = loServer.ConnectionContext.ExecuteWithResults(lcScript)
>
>                ' Adjust to our default name
>                oDataSet.Tables("Table").TableName = "Temp"
>
>                ' Record count
>                nCount = oDataSet.Tables("Temp").Rows.Count
>
>                ' If we have at least one record
>                If nCount > 0 Then
>                    oDataView = New DataView
>                    oDataView = oDataSet.Tables("Temp").DefaultView
>                    oRows = oDataSet.Tables("Temp").Rows()
>                Else
>                    oRows = Nothing
>                End If
>
>            Else
>
>                ' Execute the script
>                loServer.ConnectionContext.ExecuteNonQuery(lcScript)
>
>            End If
>
>            llSuccess = True
>        Catch loError As Exception
>            ErrorSetup(loError, lcScript)
>        End Try
>
>        ' End time
>        lnDateNow2 = Date.Now.Ticks
>
>        lnElapse = ((lnDateNow2 - lnDateNow) / 10000000)
>
>        ' Just in case
>        If lnElapse > 999.999 Then
>            lnElapse = 999.999
>        End If
>
>        nDuration = lnElapse
>        cSQLFull = lcScript
>
>        ' Add the log
>        oLogData.cLog = cSQLFull + oApp.cCR + oApp.cCR + "Duration: " + oApp.GetFormatValue(nDuration, , 4)
>        oLogData.lTimeStamp = True
>        If Not oLogData.AddLog() Then
>        End If
>
>        Return llSuccess
>    End Function
>
>
>The framework Data class has a lot of database methods. The other ones were able to be executed without this error (before I had to build a config file). I am wondering why this particular one triggers something in regards to a 2.0 version. Maybe the AddHandler would be a problem?

Doubt it. If you really want to find out you could open the project file in Notepad (or something similar) and poke around to see if you can find a reference to v2.0 components but, as before, it's probably not worth it....
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform