473,320 Members | 1,612 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Apllication variables in net

I am in the process of converting 'classic' asp to asp.net. At application
startup (global.asax) I create a prototype of table structure. Throughout my
system I copy that application prototype structure into a local variable. I
find when I make changes to that local variable they are also reflected in
the application variable. This of course defeats the purpose because
that prototype is never suppose to change, and it is never updated anywhere
in my application except in the global.asax. In the 'classic' asp version
this worked without a hitch. When I read a application variable is it
considered byref or byval?
Nov 19 '05 #1
7 988
Hi Bill.
What you are probably doing, is to copy the reference
of the object stored in the application collection.
So any changes you make, will be performed on the
object stored in the application collection.
What you need to do, is copy the object itself.
Sharon.

"Bill" <Bi**@discussions.microsoft.com> wrote in message
news:DB**********************************@microsof t.com...
I am in the process of converting 'classic' asp to asp.net. At application
startup (global.asax) I create a prototype of table structure. Throughout my system I copy that application prototype structure into a local variable. I find when I make changes to that local variable they are also reflected in
the application variable. This of course defeats the purpose because
that prototype is never suppose to change, and it is never updated anywhere in my application except in the global.asax. In the 'classic' asp version
this worked without a hitch. When I read a application variable is it
considered byref or byval?

Nov 19 '05 #2
all I do is:

table = application.contents("something")

make change to table

NEVER update application.contents("something")

After the above, application.contents("something") now reflects the changes
that I
made in table.

If the above is wrong could you give an example of how to accomplish what I
want to do?

Thanks !

"Sharon" wrote:
Hi Bill.
What you are probably doing, is to copy the reference
of the object stored in the application collection.
So any changes you make, will be performed on the
object stored in the application collection.
What you need to do, is copy the object itself.
Sharon.

"Bill" <Bi**@discussions.microsoft.com> wrote in message
news:DB**********************************@microsof t.com...
I am in the process of converting 'classic' asp to asp.net. At application
startup (global.asax) I create a prototype of table structure. Throughout

my
system I copy that application prototype structure into a local variable.

I
find when I make changes to that local variable they are also reflected in
the application variable. This of course defeats the purpose because
that prototype is never suppose to change, and it is never updated

anywhere
in my application except in the global.asax. In the 'classic' asp version
this worked without a hitch. When I read a application variable is it
considered byref or byval?


Nov 19 '05 #3
table (table = application.contents("something")) is just a reference
to the object stored in the application collection.
It is not a copy of the object.
You need to "deep copy" the object.
How to deep copy, depends on what Type "table" is.
Sharon.
"Bill" <Bi**@discussions.microsoft.com> wrote in message
news:16**********************************@microsof t.com...
all I do is:

table = application.contents("something")

make change to table

NEVER update application.contents("something")

After the above, application.contents("something") now reflects the changes that I
made in table.

If the above is wrong could you give an example of how to accomplish what I want to do?

Thanks !

"Sharon" wrote:
Hi Bill.
What you are probably doing, is to copy the reference
of the object stored in the application collection.
So any changes you make, will be performed on the
object stored in the application collection.
What you need to do, is copy the object itself.
Sharon.

"Bill" <Bi**@discussions.microsoft.com> wrote in message
news:DB**********************************@microsof t.com...
I am in the process of converting 'classic' asp to asp.net. At application startup (global.asax) I create a prototype of table structure. Throughout
my
system I copy that application prototype structure into a local
variable. I
find when I make changes to that local variable they are also

reflected in the application variable. This of course defeats the purpose because
that prototype is never suppose to change, and it is never updated

anywhere
in my application except in the global.asax. In the 'classic' asp version this worked without a hitch. When I read a application variable is it
considered byref or byval?


Nov 19 '05 #4
The application variable contains a array of structures. I really appreciate
your quick responses to my questions ! It's sooooo much easier than contact
,icrosoft support!

"Sharon" wrote:
table (table = application.contents("something")) is just a reference
to the object stored in the application collection.
It is not a copy of the object.
You need to "deep copy" the object.
How to deep copy, depends on what Type "table" is.
Sharon.
"Bill" <Bi**@discussions.microsoft.com> wrote in message
news:16**********************************@microsof t.com...
all I do is:

table = application.contents("something")

make change to table

NEVER update application.contents("something")

After the above, application.contents("something") now reflects the

changes
that I
made in table.

If the above is wrong could you give an example of how to accomplish what

I
want to do?

Thanks !

"Sharon" wrote:
Hi Bill.
What you are probably doing, is to copy the reference
of the object stored in the application collection.
So any changes you make, will be performed on the
object stored in the application collection.
What you need to do, is copy the object itself.
Sharon.

"Bill" <Bi**@discussions.microsoft.com> wrote in message
news:DB**********************************@microsof t.com...
> I am in the process of converting 'classic' asp to asp.net. At application > startup (global.asax) I create a prototype of table structure. Throughout my
> system I copy that application prototype structure into a local variable. I
> find when I make changes to that local variable they are also reflected in > the application variable. This of course defeats the purpose because
> that prototype is never suppose to change, and it is never updated
anywhere
> in my application except in the global.asax. In the 'classic' asp version > this worked without a hitch. When I read a application variable is it
> considered byref or byval?


Nov 19 '05 #5
If the Array contains structs, which are value types, then you can use
the Array class Clone or Copy method.
See Array class documentation on how to do this.

"Bill" <Bi**@discussions.microsoft.com> wrote in message
news:98**********************************@microsof t.com...
The application variable contains a array of structures. I really appreciate your quick responses to my questions ! It's sooooo much easier than contact ,icrosoft support!

"Sharon" wrote:
table (table = application.contents("something")) is just a reference
to the object stored in the application collection.
It is not a copy of the object.
You need to "deep copy" the object.
How to deep copy, depends on what Type "table" is.
Sharon.
"Bill" <Bi**@discussions.microsoft.com> wrote in message
news:16**********************************@microsof t.com...
all I do is:

table = application.contents("something")

make change to table

NEVER update application.contents("something")

After the above, application.contents("something") now reflects the

changes
that I
made in table.

If the above is wrong could you give an example of how to accomplish what
I
want to do?

Thanks !

"Sharon" wrote:

> Hi Bill.
> What you are probably doing, is to copy the reference
> of the object stored in the application collection.
> So any changes you make, will be performed on the
> object stored in the application collection.
> What you need to do, is copy the object itself.
> Sharon.
>
> "Bill" <Bi**@discussions.microsoft.com> wrote in message
> news:DB**********************************@microsof t.com...
> > I am in the process of converting 'classic' asp to asp.net. At

application
> > startup (global.asax) I create a prototype of table structure.

Throughout
> my
> > system I copy that application prototype structure into a local

variable.
> I
> > find when I make changes to that local variable they are also

reflected in
> > the application variable. This of course defeats the purpose

because > > that prototype is never suppose to change, and it is never updated
> anywhere
> > in my application except in the global.asax. In the 'classic' asp

version
> > this worked without a hitch. When I read a application variable is it > > considered byref or byval?
>
>
>


Nov 19 '05 #6
Thank you very much ! This is of course another diviation from the way
'classic' asp works.....again. Thanks.

"Sharon" wrote:
If the Array contains structs, which are value types, then you can use
the Array class Clone or Copy method.
See Array class documentation on how to do this.

"Bill" <Bi**@discussions.microsoft.com> wrote in message
news:98**********************************@microsof t.com...
The application variable contains a array of structures. I really

appreciate
your quick responses to my questions ! It's sooooo much easier than

contact
,icrosoft support!

"Sharon" wrote:
table (table = application.contents("something")) is just a reference
to the object stored in the application collection.
It is not a copy of the object.
You need to "deep copy" the object.
How to deep copy, depends on what Type "table" is.
Sharon.
"Bill" <Bi**@discussions.microsoft.com> wrote in message
news:16**********************************@microsof t.com...
> all I do is:
>
> table = application.contents("something")
>
> make change to table
>
> NEVER update application.contents("something")
>
> After the above, application.contents("something") now reflects the
changes
> that I
> made in table.
>
> If the above is wrong could you give an example of how to accomplish what I
> want to do?
>
> Thanks !
>
>
>
>
>
> "Sharon" wrote:
>
> > Hi Bill.
> > What you are probably doing, is to copy the reference
> > of the object stored in the application collection.
> > So any changes you make, will be performed on the
> > object stored in the application collection.
> > What you need to do, is copy the object itself.
> > Sharon.
> >
> > "Bill" <Bi**@discussions.microsoft.com> wrote in message
> > news:DB**********************************@microsof t.com...
> > > I am in the process of converting 'classic' asp to asp.net. At
application
> > > startup (global.asax) I create a prototype of table structure.
Throughout
> > my
> > > system I copy that application prototype structure into a local
variable.
> > I
> > > find when I make changes to that local variable they are also
reflected in
> > > the application variable. This of course defeats the purpose because > > > that prototype is never suppose to change, and it is never updated
> > anywhere
> > > in my application except in the global.asax. In the 'classic' asp
version
> > > this worked without a hitch. When I read a application variable is it > > > considered byref or byval?
> >
> >
> >


Nov 19 '05 #7
Asp.net is nothing like Asp.
To really understand Asp.net, a good understanding of
object oriented is needed.
Anyway i'm happy i could help.

"Bill" <Bi**@discussions.microsoft.com> wrote in message
news:1F**********************************@microsof t.com...
Thank you very much ! This is of course another diviation from the way
'classic' asp works.....again. Thanks.

"Sharon" wrote:
If the Array contains structs, which are value types, then you can use
the Array class Clone or Copy method.
See Array class documentation on how to do this.

"Bill" <Bi**@discussions.microsoft.com> wrote in message
news:98**********************************@microsof t.com...
The application variable contains a array of structures. I really

appreciate
your quick responses to my questions ! It's sooooo much easier than

contact
,icrosoft support!

"Sharon" wrote:

> table (table = application.contents("something")) is just a reference > to the object stored in the application collection.
> It is not a copy of the object.
> You need to "deep copy" the object.
> How to deep copy, depends on what Type "table" is.
> Sharon.
>
>
> "Bill" <Bi**@discussions.microsoft.com> wrote in message
> news:16**********************************@microsof t.com...
> > all I do is:
> >
> > table = application.contents("something")
> >
> > make change to table
> >
> > NEVER update application.contents("something")
> >
> > After the above, application.contents("something") now reflects the > changes
> > that I
> > made in table.
> >
> > If the above is wrong could you give an example of how to accomplish
what
> I
> > want to do?
> >
> > Thanks !
> >
> >
> >
> >
> >
> > "Sharon" wrote:
> >
> > > Hi Bill.
> > > What you are probably doing, is to copy the reference
> > > of the object stored in the application collection.
> > > So any changes you make, will be performed on the
> > > object stored in the application collection.
> > > What you need to do, is copy the object itself.
> > > Sharon.
> > >
> > > "Bill" <Bi**@discussions.microsoft.com> wrote in message
> > > news:DB**********************************@microsof t.com...
> > > > I am in the process of converting 'classic' asp to asp.net. At
> application
> > > > startup (global.asax) I create a prototype of table structure.
> Throughout
> > > my
> > > > system I copy that application prototype structure into a
local > variable.
> > > I
> > > > find when I make changes to that local variable they are also
> reflected in
> > > > the application variable. This of course defeats the purpose

because
> > > > that prototype is never suppose to change, and it is never updated > > > anywhere
> > > > in my application except in the global.asax. In the 'classic' asp > version
> > > > this worked without a hitch. When I read a application

variable is it
> > > > considered byref or byval?
> > >
> > >
> > >
>
>
>


Nov 19 '05 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Ross A. Finlayson | last post by:
Hi, I'm scratching together an Access database. The development box is Office 95, the deployment box Office 2003. So anyways I am griping about forms and global variables. Say for example...
7
by: Michael | last post by:
Hi newsgroup, as the subject indicates I am looking for an advice using global variables. I am not if this problem is more about style then C. If its wrong in thi group, sorry. So I have a...
1
by: samrat | last post by:
can we creat speech apllication using sdk beta 2 s/w and without using internet explorer
8
by: Glenn Thimmes | last post by:
I am needing to read and write application settings from within my ASP.NET application. My web.config is not an option since I need to be able to write settings as well. My database is not an...
9
by: CDMAPoster | last post by:
About a year ago there was a thread about the use of global variables in A97: http://groups.google.com/group/comp.databases.ms-access/browse_frm/thread/fedc837a5aeb6157 Best Practices by Kang...
7
by: misha | last post by:
Hello. I was wandering if someone could explain to me (or point to some manual) the process of mapping the addresses of host variables by DB2. Especially I would like to know when DB2 decides to...
5
by: Sandman | last post by:
I dont think I understand them. I've read the section on scope in the manual inside out. I'm running PHP 5.2.0 Here is the code I'm working on: //include_me.php <?php $MYVAR = array(); global...
1
weaknessforcats
by: weaknessforcats | last post by:
C++: The Case Against Global Variables Summary This article explores the negative ramifications of using global variables. The use of global variables is such a problem that C++ architects have...
1
by: mo/-/sin | last post by:
hi i m mohsin............ i made a application in ado.net using c# at front end and sql server 2005 at back end.......... i apply 4 text boxes in the apllication and bind it to the service...
4
by: purnimakhamri | last post by:
hi can any body tell the code for date time picker using calendar control .Am using ASP.NET 2.0 ..calandar control must be in hidden field ,if i click on that it will pop up and display the date and...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.