473,387 Members | 1,535 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,387 software developers and data experts.

VB.NET Question - Static, Shared, Confused

Thanks for any replies in advance.

I am C# Developer messing with VB.NET because I must move MANY
Functions on a web site that are written in inline HTML <SCRIPT and I
want to put them all in assemblies and call them.

However, so that I do not have to instantiate all of them all of the
time. I want them to be static methods/Functions

I read somewhere to use "Shared" that it was the same as Static but I
have since TOLD that shared does not behave like Static does -- and may
cause nightmare for me, but i have no clue.

more specifically I was told that if I used Shared Property, that one
User Session may Get confused with another session because this will
always holds the same memory locations. "This is the concept of shared"
- i was told. But this make no sense to me as HTTP is stateless
protocol, but who the hell knows at this point, I want to be sure.

1) What is the Truth? Is "shared" the VB Path to C# Static?
and/Or
2) Anyone Explain "Shared" - if it has a C# Equivalent, what is it?
Thank you all!

Nov 15 '06 #1
1 1264
static =C# = Shared=VB.NET

they represent the same data to different users, so what you heard is correct.

Peter

--
Co-founder, Eggheadcafe.com developer portal:
http://www.eggheadcafe.com
UnBlog:
http://petesbloggerama.blogspot.com


"DaBrain" wrote:
Thanks for any replies in advance.

I am C# Developer messing with VB.NET because I must move MANY
Functions on a web site that are written in inline HTML <SCRIPT and I
want to put them all in assemblies and call them.

However, so that I do not have to instantiate all of them all of the
time. I want them to be static methods/Functions

I read somewhere to use "Shared" that it was the same as Static but I
have since TOLD that shared does not behave like Static does -- and may
cause nightmare for me, but i have no clue.

more specifically I was told that if I used Shared Property, that one
User Session may Get confused with another session because this will
always holds the same memory locations. "This is the concept of shared"
- i was told. But this make no sense to me as HTTP is stateless
protocol, but who the hell knows at this point, I want to be sure.

1) What is the Truth? Is "shared" the VB Path to C# Static?
and/Or
2) Anyone Explain "Shared" - if it has a C# Equivalent, what is it?
Thank you all!

Nov 15 '06 #2

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

Similar topics

9
by: Clint | last post by:
Hey all - Excuse the cross-post ... I'm not sure what the appropriate newsgroup would be for this question. I have a question that I'm not quite sure how to ask. For all I know, I have the...
9
by: Steve Richter | last post by:
in a generic class, can I code the class so that I can call a static method of the generic class T? In the ConvertFrom method of the generic TypeConvert class I want to write, I have a call to...
9
by: Jess | last post by:
Hello, I was told that if I declare a static class constant like this: class A{ static const int x = 10; }; then the above statement is a declaration rather than a definition. As I've...
4
by: Dave | last post by:
I have a global.asax file with Application_Start defined and create some static data there and in another module used in the asp.net application and I realize that static data is shared amongst...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
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...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.