473,403 Members | 2,270 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,403 software developers and data experts.

Problem with one global class

hi,

I build one global class to store user data wich is logged in that moment.
Every thing is work fine , and this class is accessed by all other pages
from my project.
But, the problem is: when more than one user, log in in my system, this
class store user data just for only one user, overriding the others
users...it look like this class is in shared mode....
whats wrong ?

below, follow this class..

Global Class

----
Imports Web_intranet.Classes

Public Class ClasseGlobal
Public Shared UsuarioLogado As New Usuarios
End Class

-----
Nov 18 '05 #1
2 974
Well, of course they all share it. You declared the variable as 'Shared'.
That means there is one instance of it per application. So all your users
share it - and overwrite each other.

You need to use session variables, if you want to have each user access to a
unique variable.

"Ricardo Corsi" <me***********@globo.com> wrote in message
news:e5******************@TK2MSFTNGP11.phx.gbl...
hi,

I build one global class to store user data wich is logged in that moment. Every thing is work fine , and this class is accessed by all other pages
from my project.
But, the problem is: when more than one user, log in in my system, this
class store user data just for only one user, overriding the others
users...it look like this class is in shared mode....
whats wrong ?

below, follow this class..

Global Class

----
Imports Web_intranet.Classes

Public Class ClasseGlobal
Public Shared UsuarioLogado As New Usuarios
End Class

-----

Nov 18 '05 #2
hummm....thanks for your help Marina!

"Marina" <so*****@nospam.com> wrote in message
news:%2****************@tk2msftngp13.phx.gbl...
Well, of course they all share it. You declared the variable as 'Shared'.
That means there is one instance of it per application. So all your users
share it - and overwrite each other.

You need to use session variables, if you want to have each user access to
a
unique variable.

"Ricardo Corsi" <me***********@globo.com> wrote in message
news:e5******************@TK2MSFTNGP11.phx.gbl...
hi,

I build one global class to store user data wich is logged in that

moment.
Every thing is work fine , and this class is accessed by all other pages
from my project.
But, the problem is: when more than one user, log in in my system, this
class store user data just for only one user, overriding the others
users...it look like this class is in shared mode....
whats wrong ?

below, follow this class..

Global Class

----
Imports Web_intranet.Classes

Public Class ClasseGlobal
Public Shared UsuarioLogado As New Usuarios
End Class

-----


Nov 18 '05 #3

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

Similar topics

1
by: Spur | last post by:
Hi all, I implemented a memory allocation/deallocation class that logs all new/delete calls (overloaded) and remembers for each allocated block where it was allocated from (using a macro that...
4
by: Leslaw Bieniasz | last post by:
Cracow, 20.09.2004 Hello, I need to implement a library containing a hierarchy of classes together with some binary operations on objects. To fix attention, let me assume that it is a...
2
by: Mike | last post by:
Hello. I am using C# in .NET v1.1. I am trying to serialize an object to disk and read it back again. The serialization seems to work OK (at least, it completes without error). However, I get...
5
by: Hari | last post by:
Guys please help me to solve this strange problem what Iam getting as follows.. Trying to instantiate a global instance of a template class as follows :- when i build this code with debug and...
10
by: anders | last post by:
I have 2 external assemblies A1 and A2 that both define class X in the global namespace. I need to use both assemblies in my VB project but the names X are ambiguous. How can I get around this...
11
by: Ron | last post by:
I have a web project compiled with the new "Web Deployment Projects" plugin for VS2005. I'm deploying the web project to one assembly and with updateable option set to ON. When I'm running the...
1
by: sharath B N | last post by:
hi, i am sort of newbie to python. I am trying to do a super Market simulation with OOP in python. I have problems with using a class instance as global... def generate (... ,....,...) " in...
2
by: sorobor | last post by:
dear sir .. i am using cakephp freamwork ..By the way i m begener in php and javascript .. My probs r bellow I made a javascript calender ..there is a close button ..when i press close button...
1
by: Brock | last post by:
Thanks in advance... (you can see a screenshot of what my form looks like currently at http://www.juggernautical.com/DataGrid.jpg - the Datalist is super-imposed in 'design view' but the DataGrid...
2
coolv
by: coolv | last post by:
Hello I have problem in my page that the dropdown box is not displaying data according to selection of first dropdown.Please help me. Below is my code. thanks.............. <?php ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.