I am creating my first .NET application in Visual Basic using Visual Studio 2010 RC. I need a place to store SQL query strings that I will use to populate controls on my forms. I started to store these strings in the project resources or settings, but then thought that that might not be very safe. So I thought I would create a class with a dictionary object in it and store my query strings there.
In VBA, a class has an initialize event that fires when the class is instanced. I cannot find such an event for .NET classes. My question is, do I just need to create a Sub called "New" and will it automatically be fired when a create a new instance of this class? If so, the code below should populate my dictionary with all the SQL strings I need for my application when the class is created (right?).
If you see any problems with this, please let me know. Or if you can suggest a better way to do what I'm trying to do, I'll also award points.
Dim dictLookup As New Dictionary(Of String, String)
dictLookup.Add("query1", "select * from customers")
dictLookup.Add("query2", "select * from employees")
dictLookup.Add("query3", "select * from cities")