-
Configuration File in C#
Hi,
In VB.Net projects, you can specify a configuration file where in you can define the connection string and other variables.
I notice that in C#, there is no configuration file.
What is the equivalent of a configuration file in C#? I wanted to declare my connection string externally so that even I change database connections, I dont have to compile the program again.
Many thanks.
-
Its the same thing in C#. Right click in the solution explorer click Add->Add New Item-> web.config
-
I don't have any
Hi DevGrp,
Why is that I don't have any web.config? I have Visual Studio 2002.
Thanks.
-
Are you building a Web app or a Windows Form app? It should be app.config if you are building a Windows Forma app.
-
Hello,
I'm building a windows apps. When I right click on the solution explorer->add new item, I can't see any template for Application Configuration File.
What I did was I just type in app.config.
Thanks DevGrp.
-
Right click in the solution explorer click Add->Add New Item-> Application Configuration File (at the bottom) .
-
Hi Pirate,
I can't see any application configuration file when adding new item. But in VB.Net Projects, its there. I wonder what's wrong?
-
On the left side of the box that pops up, there is a box with a plus sign click on it and you should get more stuff.
-
Right click on the proj name (not the solution name) , then Add New Item then follow the above instruction .
-
It's really not there!
Hi DevGrp and Pirate,
I did all your instructions, but its really not there. This is only in C# projects, in VB projects, the application config file is existing. Anyway, I just typed in app.config and just copied my setting from my VB projects.
Thanks Guys!
-
Weird , What version are you on ?
-
I have Visual Studio 2002
-
Then I think it's not there . But I'm still sure it exists in VS.NET 2003 . :)