Global information

thomasita

Newcomer
Joined
Nov 2, 2004
Messages
2



Hi Everyone, I'm having some troubles working on a project that involves ASP's an Oracle connection.

The thing is that I need to have a global variable that will comunicate with the webservice that connects to the data base.

I've been reading some articles and I've found that I can declare global variables in ASP's using Application like this:

myServer.Service1 Server1 = new myServer.Service1();
Application.Add("Server",Server1);

in the Global.asax.

It does work when I try to connect to de data base using the first web page, but when I call it from other page from the project I've got this message:

"Operation is not valid due to the current state of the object."

I've tried also to update the state of the object in the first page doing this:

MyServer.Service1 servidor = (MyServer.Service1)Application.Get("Server");

// Some code using variable server
//...
// then
Application.Set("Server",servidor);
Application.UnLock();

I believe it must be something simple, but I'm really new on this.

I whish somebody could help me, please.


 




Thank you for the tip, but It threw me the same error about the object.

Is there a method that reserves or release the object from a page to another?
How exactly can I use this static object from page to page?
Is there another way?




 
Back
Top