A
Alexander Kaplunov
Happy New Year everybody!
I have a asp.net web application, which has aspx files with code-behind and
also some .cs files. My question is how can I get to Application object
within C# objects (.cs files)? I can write the code...
string str = (string)Application["test"];
and it compiles OK but I get the runtime error...
System.NullReferenceException: Object reference not set to an instance of
an object.
Any ideas?
Here is a more detailed description of what I'm trying to do...
I want to store an SqlConnection in an Application object and then have the
data extracted from the database by another object, which only deals with
the database. Is this even the right way of doing it?
Any suggestions would be greatly appriciated.
Thanks,
Alex.
I have a asp.net web application, which has aspx files with code-behind and
also some .cs files. My question is how can I get to Application object
within C# objects (.cs files)? I can write the code...
string str = (string)Application["test"];
and it compiles OK but I get the runtime error...
System.NullReferenceException: Object reference not set to an instance of
an object.
Any ideas?
Here is a more detailed description of what I'm trying to do...
I want to store an SqlConnection in an Application object and then have the
data extracted from the database by another object, which only deals with
the database. Is this even the right way of doing it?
Any suggestions would be greatly appriciated.
Thanks,
Alex.