Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
2 simultaneous calls to a webservice wreaks havoc
Message
De
28/01/2006 11:41:29
 
Information générale
Forum:
ASP.NET
Catégorie:
Code, syntaxe and commandes
Versions des environnements
Environment:
C# 1.1
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
MS SQL Server
Divers
Thread ID:
01090751
Message ID:
01091169
Vues:
16
Paul,

It's ok for the ConnectionString to be static, but I was suggesting that perhaps you have defined the connection itself to be static. The Connection itself typically shouldn't be passed around between method calls (unless you're doing transactions), because it should only be created as needed.

Maybe you could post some little snippets of code so we can see where you might be going wrong?

~~Bonnie



>Hi Bonnie,
>
>Thanks for your help on that...when I have a value like a DB Connection String for example. I guess it's not a good idea to save that in a variable that can be access by different methods and functions? Because the only way to do that would be to make the variable static, right? and if someone else logs into the webservice that variable would be "stomped on".
>
>So I take it the only way to do this would be to set a "non-static" variable and pass it throughout all of the calls as a parameter?
>
>Is this the best and/or only way to do it? Or is there something else in this .net world I could be doing? Thanks again for both of your help..
>
>Paul
>
>>Paul,
>>
>>The Shared is VB. In C#, it's called static. You've probably got a static method or property somewhere (like maybe your connection) that shouldn't be static.
>>
>>~~Bonnie
>>
>>
>>
>>>..snip..
>>>>
>>>>You probably have the same problem I had recently. Remove the Shared attribute of the related variables/methods and that should work.
>>>
>>>Thanks for the reply..I'm not sure what you are referring to. Are you talking about the actual variable/method declarations. If so I don't have the word "shared" anywhere on the declarations.
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