Accessing Application Settings in C#.NET

E

Ed Cohen

I want to utilize the application settings that are provided in VS 2005 Pro
AND access them via C#. The examples on line are all in VB.NET. I have looked
on-line for the appropriate classes (Settings), but everything is in VB. I
have not had any luck. If anyone has done this in C#.NET please post some
code that does this. Thank you

Ed Cohen
 
H

Hillbilly

// No luck required, this search works very well for me...
c# ConfigurationManager site:msdn.microsoft.com
 
E

Ed Cohen

Hillbilly said:
// No luck required, this search works very well for me...
c# ConfigurationManager site:msdn.microsoft.com

First of all, thank you for your response. I went to those sections in MSDN,
and tried the various examples but I still could not get access to the
Settings part of my project. In VB you have the My.Settings object. Ok, what
I have done is to create a new setting, called MySQLConnection in the
project's settings section. I am using VS 2005 pro. I want to be able to
access this connection string in the applications settings instead of hard
coding it. So, I really need some extra help here. I get close, but no cigar!
Thanks.

Ed Cohen
 
D

Duggi

I want to utilize the application settings that are provided in VS 2005 Pro
AND access them via C#. The examples on line are all in VB.NET. I have looked
on-line for the appropriate classes (Settings), but everything is in VB. I
have not had any luck. If anyone has done this in C#.NET please post some
code that does this. Thank you

Ed Cohen

If you are talking about app.config, settings that you want to make to
your application...

If you are using VS, right click on the project and addfile and then
select Application Configuration File.
You may also want to explore, System.Configuration namespace. and
ConfigurationManager class also.

-Cnu
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top