Ask a Question related to ASP Components, Design and Development.
-
Martin #1
How to use object shared on the Application level in the User Cont
Hi,
I am a newbie to ASP.NET and I would like to ask you to help me with the
following problem.
First, We have a class to represent a sql query repository, which would be
shared between the session (the idea is to load the repository only once when
the application is starting and then add the object inside the Application
object collection). As a result, the Application['SqlRepository'] contains
the instantiated object.
Second, we have overloaded SqlDataSource object which gives the query name
and the repository object and when the process of a query is requested, it
loads the query command text from the repository.
Finally, the problem is the following. How to get the repository object from
the Application object automatically from the customized DataSource object.
We just would like to prevent the situation that the programmer will have to
set the repository property manually from the Application object in the code.
This means we would like to automatically propagate the
Application['SqlRepository'] value to all of the current/future instances of
our customized DataSource in the runtime.
Thank you for your hint,
Martin
Martin Guest
-
Shared user object array
Maybe I am miss understanding this, but I have taken the sample_textchat application and have modified it slightly for my usage, I have got; ... -
HELP: ASP.NET Web Application, Impersonating User and Creating Threads via C++ COM Object
Sorry for the long subject, but it summarizes my issue nicely. I have an ASP.NET application running ... it's a web app running under IIS. For... -
How to find which level of the object on?
I do have my own constructor function for object. Say I have the constructor Ball(); I then: var Ball1 = new Ball(); Flash knows which level... -
Application level variables
Christopher wrote: you need a permanent data store. usually available resources include text files, RDMS and code. global.asa is a good place... -
does an Sqlconnection object get shared at application level?
thanks Paul, I did not think tht a variable would be shared application wide just because it was declared as static. I figured it would be session... -
Martin #2
RE: How to use object shared on the Application level in the User Cont
Hi,
I have finally found it. If I am not right, please correct me.
protected SqlRepository SqlRepository
{
get
{
return (HttpContext.Current.Application["SqlRepository"] as
SqlRepository);
}
}
Martin
"Martin" wrote:
> Hi,
>
> I am a newbie to ASP.NET and I would like to ask you to help me with the
> following problem.
>
> First, We have a class to represent a sql query repository, which would be
> shared between the session (the idea is to load the repository only once when
> the application is starting and then add the object inside the Application
> object collection). As a result, the Application['SqlRepository'] contains
> the instantiated object.
>
> Second, we have overloaded SqlDataSource object which gives the query name
> and the repository object and when the process of a query is requested, it
> loads the query command text from the repository.
>
> Finally, the problem is the following. How to get the repository object from
> the Application object automatically from the customized DataSource object.
> We just would like to prevent the situation that the programmer will have to
> set the repository property manually from the Application object in the code.
> This means we would like to automatically propagate the
> Application['SqlRepository'] value to all of the current/future instances of
> our customized DataSource in the runtime.
>
> Thank you for your hint,
>
> MartinMartin Guest
-
Anthony Jones #3
Re: How to use object shared on the Application level in the User Cont
"Martin" <Martin@discussions.microsoft.com> wrote in message
news:1B38E626-E8CA-4417-BB6A-57887284F470@microsoft.com...This group is for Classic ASP.> Hi,
>
> I have finally found it. If I am not right, please correct me.
>
> protected SqlRepository SqlRepository
> {
> get
> {
> return (HttpContext.Current.Application["SqlRepository"] as
> SqlRepository);
> }
> }
>
> Martin
Try asking in the microsoft.public.dotnet.framework.aspnet group
Anthony Jones Guest



Reply With Quote

