473,385 Members | 1,983 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Accessing Application Settings in C#.NET

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
Oct 4 '08 #1
3 2903
// No luck required, this search works very well for me...
c# ConfigurationManager site:msdn.microsoft.com

"Ed Cohen" <Ed*****@discussions.microsoft.comwrote in message
news:C7**********************************@microsof t.com...
>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
Oct 4 '08 #2


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

"Ed Cohen" <Ed*****@discussions.microsoft.comwrote in message
news:C7**********************************@microsof t.com...
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

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
Oct 5 '08 #3
On Oct 4, 7:38*am, Ed Cohen <EdCo...@discussions.microsoft.comwrote:
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
Oct 5 '08 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Serge calderara | last post by:
Dear all, Does any one have a ready class that is able to access a configuration file and make different type of querry, read, write operation? Why re invanting the real if something already...
3
by: prodirect | last post by:
Hi all, I hope someone can help me. I've recently created a database and wanted to put it up on an ftp sight so that multiple people could access the same tables at the same time from different...
0
by: Joergen Bech | last post by:
Fairly new to ASP.NET 1.1. Getting the error below when running application on a web server outside of my control, but only the first time I run it: 1. After a long period of inactivity (or...
9
by: Stacey | last post by:
I am using Visual Studio 2005, creating a VB.NET program. I am have created a settings file and two settings in the file. The section that it created in my app.config is below. I can not figure...
2
by: amyl | last post by:
I have added some user scope level variables in my Windows Forms Application. However, I can't seem to access them. >From the doc's I found that you should be able to access them via...
0
by: CoderHead | last post by:
I understand what's happening, but not why. I hope somebody else can help me out. I wrote a class library - DataAccess. This library can be included in any type of application but for now is...
1
by: bg_ie | last post by:
Hi, I have my own UserSettings class that I wish to include within my windows application. To include it at the moment, I do something like this - namespace WindowsApplication1 { static...
12
by: Doug | last post by:
I'm trying to access a schema file as such: Dim settings As XmlReaderSettings = New XmlReaderSettings() settings.Schemas.Add(webServiceNamespace, schemaFileName) settings.ValidationType =...
4
by: Jon | last post by:
I wrote a VS 2005 C# express programme that accesses a web service. It works fine when there's a direct connection to the internet, but on two different PCs with internet access via a proxy, I get...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.