I have an app that needs to set the connectionstring based upon an arg that is passed at runtime. I would like to access that argument in any method to create the connectionstring instead of having to pass the value to every method as some methods have quite a few variables passed to it. Since this value will be the same whereever it's called, it can be set once and just be referenced when needed.
I'm more of a vb developer so what would that look like? Right now I have
Main (string args[])
I use the last param to tell which server.
So you are saying I can set the connection string in main to a member variable and I would be able to access that variable from any method?
Do you know where I could see a simple example of how that looks?
Free Guide: Managing storage for virtual environments
Complete a brief survey to get a complimentary 70-page whitepaper featuring the best methods and solutions for your virtual environment, as well as hypervisor-specific management advice from TechTarget experts. Don’t miss out on this exclusive content!
Discuss This Question: 3  Replies