Superfly1611 Posted March 6, 2005 Posted March 6, 2005 Hello all, I'm predominantly a web developer and have next to no windows forms programming - and certainly none since VB6. When writing a windows form program in .Net how do I declare variables that can be accessed from any form in my application? In VB6 I would tend use modules to declare public data and new data types. If it makes any difference what I want to store is a database connection string and I do not want to store it in the registry. Thanks Quote
Administrators PlausiblyDamp Posted March 6, 2005 Administrators Posted March 6, 2005 If you just wish to store configuration information then you may want to investigate dynamic properties or just use the configurationSettings Class directly in your code. Quote Posting Guidelines FAQ Post Formatting Intellectuals solve problems; geniuses prevent them. -- Albert Einstein
pas30339 Posted March 6, 2005 Posted March 6, 2005 If you just wish to store configuration information then you may want to investigate dynamic properties or just use the configurationSettings Class directly in your code. Also, check out this quick read about encryptiing your connection strings in your .config file. Better safe than sorry!! http://www.c-sharpcorner.com/Code/2003/May/SecureSiteWithASPNET2.asp Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.