473,700 Members | 2,649 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 2911
// No luck required, this search works very well for me...
c# ConfigurationMa nager site:msdn.micro soft.com

"Ed Cohen" <Ed*****@discus sions.microsoft .comwrote in message
news:C7******** *************** ***********@mic rosoft.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# ConfigurationMa nager site:msdn.micro soft.com

"Ed Cohen" <Ed*****@discus sions.microsoft .comwrote in message
news:C7******** *************** ***********@mic rosoft.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...@discus sions.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.Configur ation namespace. and
ConfigurationMa nager 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
2354
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 exist and as we share things in usegroup in general... thanks for your help
3
4318
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 geographical locations. I have been completely unsucessful in acheiving this goal so far however. Things I have tried: Create a shortcut to ftp sight via browser then tried to map local drive to
0
2263
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 updating the code-behind dll) accessing any aspx page in the application causes the application to run for the first time. Some of the initialization involves reading and writing some text and xml files using simple streamreader and streamwriter...
9
13259
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 out how to access the two settings. I need to be able to get the data out of the settings. And update them at a later point as well. I have tried all sorts of things. Dim CurReceipt As Integer =...
2
2198
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 Configuration.Settings.Default which did not work for me. Than I found another reference that you could use Properties.Settings.Default and that did not work either. Both give errors that "Properties" does not exist in this context or that I am missing...
0
1337
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 included in an ASP.NET application. The connection strings for the DataAccess library are contained in the web.config file but I wrote the library without including System.Web (because it's not just for Web apps). So I get my connection strings...
1
1595
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 class Program {
12
3023
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 = ValidationType.Schema Even though the webServiceNamespace value above is set to an intranet address, I keep getting this error:
4
4465
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 this exception: System.Net.WebException: The request failed with HTTP status 407: Proxy Authentication Required. at System.Web.Services.Protocols.SoapHttpClientProtocol.ReadResponse(SoapClientMessage message, WebResponse response, Stream...
0
8726
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9214
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9075
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8925
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6561
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5903
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4657
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
2392
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2028
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.