Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Scoping of class property
Message
From
19/12/2005 14:13:48
 
 
To
19/12/2005 13:48:05
General information
Forum:
ASP.NET
Category:
Coding, syntax and commands
Miscellaneous
Thread ID:
01079106
Message ID:
01079289
Views:
33
>No clue what that might be, sorry.

It seems to be related to multiple instances of this object being created. Basically, the application returns various errors that can occur in regards to loDataAdapter if it is being instantiated also elsewhere in a function called from that method. There must be something else I need to adjust.

This is one method of the Web Service method I am calling which may work sometimes and other times not:
        <WebMethod()> _
        Public Function GetWebServiceHit(ByVal tnRecord As Integer) As DataSet
            Dim cData As String
            Dim loDataProvider As Framework.Data = New Framework.Data
            cData = Framework.FileFunction.GetIni(Framework.App.cStartupDirectory + "\Main.ini", "System", "Data")
            CheckLogin()
            If loDataProvider.SQLExec("SELECT TOP " + tnRecord.ToString + _
             " WSH.Numero,WSH.AddDate,WSH.Method,WSH.Lap,Member.Prenom,Member.Nom,WSH.IP FROM WSH " + _
             "INNER JOIN " + cData + _
             "\Member ON WSH.AddUser=Member.Numero ORDER BY WSH.Numero DESC", App.aConnection(1)) = False Then
                Throw New System.Exception("GetWebServiceHit: " + Framework.App.cError)
            End If
            Return loDataProvider2.oDataSet
        End Function
loDataProvider seems to be properly instantiated. However, CheckLogin() makes also use of such instantiation. So, sometimes it work, sometimes it don't. I get all kind of error messages in CheckLogin() in reference to loDataProvider.

What I found to resolve the issue was to rename loDataProvider to loDataProvider2 in the method. This seems to indicate that loDataProvider was not really private in this method as it was conflicting with another instance if created with the same name elsewhere down below. Isn't there a way to have the instantiation to be private to the method? Basically, I am looking for the Local equivalent in .NET. I though DIM was doing it.
Michel Fournier
Level Extreme Inc.
Designer, architect, owner of the Level Extreme Platform
Subscribe to the site at https://www.levelextreme.com/Home/DataEntry?Activator=55&NoStore=303
Subscription benefits https://www.levelextreme.com/Home/ViewPage?Activator=7&ID=52
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform