|
-
Sep 11th, 2003, 08:30 PM
#1
Thread Starter
Addicted Member
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.
-
Sep 11th, 2003, 11:22 PM
#2
Frenzied Member
Its the same thing in C#. Right click in the solution explorer click Add->Add New Item-> web.config
-
Sep 12th, 2003, 12:14 AM
#3
Thread Starter
Addicted Member
I don't have any
Hi DevGrp,
Why is that I don't have any web.config? I have Visual Studio 2002.
Thanks.
-
Sep 12th, 2003, 12:25 AM
#4
Frenzied Member
Are you building a Web app or a Windows Form app? It should be app.config if you are building a Windows Forma app.
Last edited by DevGrp; Sep 12th, 2003 at 12:30 AM.
-
Sep 12th, 2003, 01:37 AM
#5
Thread Starter
Addicted Member
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.
-
Sep 12th, 2003, 05:39 AM
#6
Sleep mode
Right click in the solution explorer click Add->Add New Item-> Application Configuration File (at the bottom) .
-
Sep 13th, 2003, 12:36 AM
#7
Thread Starter
Addicted Member
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?
-
Sep 13th, 2003, 06:32 AM
#8
Frenzied Member
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.
-
Sep 13th, 2003, 06:42 AM
#9
Sleep mode
Right click on the proj name (not the solution name) , then Add New Item then follow the above instruction .
-
Sep 14th, 2003, 09:33 PM
#10
Thread Starter
Addicted Member
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!
-
Sep 15th, 2003, 02:57 AM
#11
Sleep mode
Weird , What version are you on ?
-
Sep 15th, 2003, 04:15 AM
#12
Thread Starter
Addicted Member
I have Visual Studio 2002
-
Sep 15th, 2003, 07:38 AM
#13
Sleep mode
Then I think it's not there . But I'm still sure it exists in VS.NET 2003 .
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|