You are right, you can't use session variables in windows applications. But
you can't use static variables in web applications for the reason you know.
Therefore you have to compromise. The dll has to use something suitable for
both web and windows. For example, a global object responsible for keeping
public data. A web application should use session variables and take care of
instantiating the global object on every request . A windows application can
instantiate the object just once in the beginning.
By the way, there is no problem for a dll running in asp.net application to
access session variables. HttpContext.Current.Session will do the job.
Eliyahu
"Mrs. Conni Drejer" <Mr************@discussions.microsoft.com> wrote in
message news:BD**********************************@microsof t.com...
Thank you for your answer, but I cannot use session variables in the DLL
or in my windowsapplications or can I ?
"Eliyahu Goldin" wrote:
You should use session variables.
Eliyahu
"Mrs. Conni Drejer" <Mrs. Conni Dr****@discussions.microsoft.com> wrote
in message news:E9**********************************@microsof t.com... Please help anyone: I have made a DLL (for DBCommunication) in which I
have defined some public static variables/fields in a public class. This
because I want these variables to be shared in all methods in the total
application. Both web- and windowsapplications and other DLL's are using this DLL.
When one of the Web-application uses the DLL, my variables are shared
across sessions, but I do not want this to happen - I want the variables to
be unique per session - can't this be done in anyway? The excuse for my
English is that I am a Danish lady in need:-)