Solved

public shared classes

Posted on 2008-10-13
1
164 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 Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Article by: jpaulino
XML Literals are a great way to handle XML files and the community doesn’t use it as much as it should.  An XML Literal is like a String (http://msdn.microsoft.com/en-us/library/system.string.aspx) Literal, only instead of starting and ending with w…
Parsing a CSV file is a task that we are confronted with regularly, and although there are a vast number of means to do this, as a newbie, the field can be confusing and the tools can seem complex. A simple solution to parsing a customized CSV fi…
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…

760 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now