Hi,
I have used Shared functions for Connection, User, and Setup variables in my
application.
That works well for the client app, but when I was now accessing my
functions via ASP.NET of course I ran into trouble (shared is shared over
the whole application, not only a session)
So, To re-write my app to handle a local reference of the objects above, its
a "little" work (100 forms, several hundred classes)
Well If I need to, Its 6 hours hard work and its done, but what is the best
way to do it?
The diffrent approaches I see is:
First, Merge the three object into one class, call it SystemData or
whatever.
Then I can either:
Create a local variable, and on each class and form use New() to pass my
information.
Or
Create a new Base Class and Base Form that all other inherits from, in that
base, create a local protected variable and use New() to set it.
Does anybody have a better idea?
If not, which of the above is the best way to do it?
Regards
Fredrik Melin 2 948
Fredrik,
I would consider making Connection, User, and Setup shared properties
instead of variables.
Then make the bodies of the properties reference the Session object instead
of an actual shared variable.
Something like:
Public Shared Property Connection As Object
Get
Return Session("connection")
End Get
Set(ByVal value As Object)
Session("connection") = value
End Set
End Property
Of course you would use the actual type for the Connection property instead
of Object.
This allows your code to continue using Whatever.Connection without needing
to be modified.
Hope this helps
Jay
"Fredrik Melin" <me*@n.o.spam.dacsa.net.remove.as.needed> wrote in message
news:AY********************@giganews.com... Hi,
I have used Shared functions for Connection, User, and Setup variables in
my application. That works well for the client app, but when I was now accessing my functions via ASP.NET of course I ran into trouble (shared is shared over the whole application, not only a session)
So, To re-write my app to handle a local reference of the objects above,
its a "little" work (100 forms, several hundred classes)
Well If I need to, Its 6 hours hard work and its done, but what is the
best way to do it?
The diffrent approaches I see is:
First, Merge the three object into one class, call it SystemData or whatever.
Then I can either:
Create a local variable, and on each class and form use New() to pass my information.
Or
Create a new Base Class and Base Form that all other inherits from, in
that base, create a local protected variable and use New() to set it.
Does anybody have a better idea? If not, which of the above is the best way to do it?
Regards Fredrik Melin
Hi,
Hmm, I think I described it a little poorly
(or I dont understand your solution)
The classes that I am talking about, isnt web-based by default, they are
build for a Windows form applicaton (that works well with shared variables)
For the WEB part, I compile those classes into a "Support dll (assembly)"
that is a separate solution with physical files linked from the windows form
solution.
So the web programmer, do only reference my support dll and he has all
functionallity that exists in the Windows Form application.
So only way the Support dll can interact with sessions is if the user sends
data into it before calling a function.
The problem is then If I Store the data in a shared variable inside the
support dll, it will be shared between all users using the ASP application.
Regards
Fredrik
"Jay B. Harlow [MVP - Outlook]" <Ja********@email.msn.com> wrote in message
news:ee*************@TK2MSFTNGP11.phx.gbl... Fredrik, I would consider making Connection, User, and Setup shared properties instead of variables.
Then make the bodies of the properties reference the Session object
instead of an actual shared variable.
Something like:
Public Shared Property Connection As Object Get Return Session("connection") End Get Set(ByVal value As Object) Session("connection") = value End Set End Property
Of course you would use the actual type for the Connection property
instead of Object.
This allows your code to continue using Whatever.Connection without
needing to be modified.
Hope this helps Jay
"Fredrik Melin" <me*@n.o.spam.dacsa.net.remove.as.needed> wrote in message news:AY********************@giganews.com... Hi,
I have used Shared functions for Connection, User, and Setup variables
in my application. That works well for the client app, but when I was now accessing my functions via ASP.NET of course I ran into trouble (shared is shared
over the whole application, not only a session)
So, To re-write my app to handle a local reference of the objects above, its a "little" work (100 forms, several hundred classes)
Well If I need to, Its 6 hours hard work and its done, but what is the best way to do it?
The diffrent approaches I see is:
First, Merge the three object into one class, call it SystemData or whatever.
Then I can either:
Create a local variable, and on each class and form use New() to pass my information.
Or
Create a new Base Class and Base Form that all other inherits from, in that base, create a local protected variable and use New() to set it.
Does anybody have a better idea? If not, which of the above is the best way to do it?
Regards Fredrik Melin
This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: John |
last post by:
Internet Facing SQL Server, Login Security? How?
I would think that our Project is fairly common. We're stuck on a
security question.
We have a typical SQL Server 2000, running under Windows...
|
by: dixie |
last post by:
I have been running some code from a form's on open event to run regedit if
a registry key does not exist in the registry. It has been working fine,
but I have had the path to the registry fix...
|
by: Peter Oliphant |
last post by:
I've been trying all morning to convert my 2003 project (managed) to 2005
(/clr since I have both managed and unmanaged code). I'm guessing I have
tens of thousands of lines of code to change. Did...
|
by: suresh chowdary |
last post by:
In internet explored my Asp.Net proect is working properly. but the same
is not working in Netscape. Tell me any solution please
*** Sent via Developersdex http://www.developersdex.com ***...
|
by: Brett |
last post by:
If I have many hard coded values such as file paths, file names, timeouts,
etc, where is the best place to define them? Meaning, in the case something
needs changing for example, rather than...
| |
by: Joel Byrd |
last post by:
I'm having a little problem with using type-ahead functionality for an
auto-suggest box. Sometimes, when I start to type something and the
type-ahead shows up, the AJAX will send a request query...
|
by: dantan98 |
last post by:
Hello all...
Please don't ask me why, but I am currently tasked to somehow discover
when the hard drive is being accessed (for reads and writes). All of
the searching I have done has been...
|
by: Lauren Wilson |
last post by:
Discovered this interesting comment on MSDN:
"To programmatically obtain the hard disk's serial number that the
manufacturer assigns, use the Windows Management Instrumentation (WMI)...
|
by: rakesh kumawat |
last post by:
I am facing a problem while reading the result which is loaded in DOMDocument.
In which I am sending a request to web service and getting a record of
Single Order.
This is my VB Code which is i am...
|
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,...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
| |
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...
|
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...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...
| |