Superfly1611 Posted June 6, 2005 Posted June 6, 2005 Hey all, I'm trying to develop a fairly simple windows form application and i'm having a few problems (stemming from the fact that i've go no idea what i'm doing as i'm a web developer). 1 I create a new folder inside my project in Visual Studio and put files (such as an Access Database or config files) inside this folder. But when I build this project the newly compiled exe in the new directory doesn't automatically copy these files accross. Now I can obviously do it manually but I find it hard to believe there isn't a way to get visual studio to do this for you at compile time? 2 Where do I store variables (such as data connection strings) so that they can be accessed from absolutely anywhere in the application? It's easy in web apps because you store it in application state. I know I could do things like storing in the registry etc but thats overkill for what I want. A few years back when I played with VB6 I used to store such variables in a module. Many Thanks Quote
Administrators PlausiblyDamp Posted June 6, 2005 Administrators Posted June 6, 2005 If you select the mdb file in the Solution Explorer you should be able to set its Build Action to Content from the properties window. It should now be copied to the output directory. Easiest way of storing application settings is to add an app.config file to your project - this works similar to a web.config in terms of how you store / access values. Quote Posting Guidelines FAQ Post Formatting Intellectuals solve problems; geniuses prevent them. -- Albert Einstein
Superfly1611 Posted June 11, 2005 Author Posted June 11, 2005 I knew visual studio would let me do it somehow! I'll look up a reference for App.Config, seems easy enough. Thanks for your help. 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.