Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Scoping of class property
Message
De
19/12/2005 14:20:24
 
 
À
19/12/2005 14:13:48
Information générale
Forum:
ASP.NET
Catégorie:
Code, syntaxe and commandes
Divers
Thread ID:
01079106
Message ID:
01079292
Vues:
34
Michel,

Without seeing how you've defined things in your Framework.Data class, I cannot take a guess as to what the problem might be. You've obviously gotten something coded incorrectly in your class definition. Can you post some of the relevant stuff?

~~Bonnie




>>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.
Bonnie Berent DeWitt
NET/C# MVP since 2003

http://geek-goddess-bonnie.blogspot.com
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform