473,378 Members | 1,555 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,378 software developers and data experts.

AppSettingsReader Question (1.1)

I have googled several articles on how to get an AppSettings out of the
web.config and into a string in C# and none of them work.

The following code gets an error on the = sign in myString =

I have tried every option on the second parameter trying to specify string.
What's wrong with the last statement? What statement would work?

Thanks,

T

AppSettingsReader myReader = new System.Configuration.AppSettingsReader();

SqlConnection connCP = new SqlConnection();

string myString = null;

myString = myReader.GetValue("connCP.ConnectionString",
typeof(System.String));
May 11 '06 #1
0 1587

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

Similar topics

0
by: Marty McDonald | last post by:
We've created our own configuration handler. Some of our existing apps currently have... AppSettingsReader MyConfigRdr = new AppSettingsReader(); string strConfigValue =...
0
by: keyway | last post by:
I'm trying to read settings in the App.config file in a .NET com library app using the following code: System.Configuration.ConfigurationSettings.AppSettings("foo") This works fine in ASP.NET,...
2
by: rawCoder | last post by:
Hi, Consider following app.config <configuration> <appSettings> <add key="Fields" value="Field1" /> <add key="Fields" value="Field2" /> <add key="Fields" value="Field3" /> </appSettings>...
3
by: Lloyd Dupont | last post by:
for this config file: //-------- <?xml version="1.0" encoding="utf-8" ?> <configuration> <appSettings> <add key="Lion's Port" value="1971"/> </appSettings> </configuration> //--------
7
by: jdn | last post by:
I have a class called myConfigurationClass with 3 private members, and 3 public gets (so, 3 read-only properties). So, for instance private members: _A, _B, _ public gets A, B, Oh, and they...
1
by: Jet Leung | last post by:
Hi all, I had written a codes like this: // my code 1 string a; System.Configuration.AppSettingsReader AppReader=new AppSettingsReader();...
0
by: Matt Adamson | last post by:
Guys, When writing unit tests for our assemblies we'd like to change configuration values at runtime for some tests i.e. to test all code paths are executed. e.g. one method would create a test...
4
by: BLUE | last post by:
VS .NET 2003 CF In this method I cannot catch exceptions thrown by Settings constructor (for example FileNotFoundException) but only an OutOfMemory exception due to Get returning void. Why??? ...
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: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
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: 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?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

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.