Solved

public shared classes

Posted on 2008-10-13
1
172 Views
Last Modified: 2012-05-05
dGreetings,

My program manages exam questions.  Each question is assigned to a Bank.  The Bank database table contains the Bank names, passwords, which Banks are currently opened, etc.  In VB6 I had a class that tracked Bank data that was instantiated in the Startup form.  Anytime  a form (or other class) needed to read the Bank information,  I created a Bank Class and used a Set to assign the class to the one that was instantiated in the Startup form.  This way all parts of the program could read current bank information without having to read the database.  

Is there a better way in Visual Net?  Using Public Shared procedures in my Bank class does not allow me to use Structures that are defined in the Bank Class.  

I guess I could move all the information to the Database, it just seems that there should be a way to reduce the amount of time spent reading the Bank Table.

Thanks




0
Comment
Question by:vaughnwhitehead
1 Comment
 
LVL 59

Accepted Solution

by:
Kevin Cross earned 350 total points
ID: 22708454
You should be able to access Shared members of your class from Shared method.  You should be able to use a data layer that is shared no problem as long as you properly account for multiple threads writing to data; however, sounds like you have multiple read situation.

Regards,
Kevin
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction As chip makers focus on adding processor cores over increasing clock speed, developers need to utilize the features of modern CPUs.  One of the ways we can do this is by implementing parallel algorithms in our software.   One recent…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

839 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question