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

Web Configue

I'm working on a WINDOWS application.
I created a configuration file with the name of "MyProjectName.exe.config".
I loaded the following configuration information into the file:
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<appSettings>
<add key="ConnectStr"
value="MyConnectionString />
<add key="DataBase"
value="VideoStore"/>
<add key="DbOwner"
value="jheavey"/>

</appSettings>
</configuration>

I attempted to access the configuration file in the same manner as I would
in a "VB" Application, but it did not like the format, so I added the
"get" method, but nothing comes back, what am I doing wrong?

Here is my code...

private string connString =
System.Configuration.ConfigurationSettings.AppSett ings.Get("ConnectStr");

Thanks in advance for your assistance!!!!!!!!
Nov 15 '05 #1
1 1159
hi,

To acces a KEY you can use the "Item" property, in C# is the indexer::

private string connString =
System.Configuration.ConfigurationSettings.AppSett ings["ConnectStr"];
--
Nos vemos.
Guillermo
--------------
P.S.
Si te parece últil mi sitio:
http://www.elguille.info/lonuevo/lo_nuevo0312.htm#dic30
--------------
Microsoft VB MVP desde 1997
Te invito a mi sitio dedicado al VB y más...
http://www.elguille.info/
http://www.mundoprogramacion.com/
(puede que el correo usado sea anti-spam)
"Jim Heavey" <Ji*******@nospam.com> wrote in message
news:Xn*********************************@207.46.24 8.16...
I'm working on a WINDOWS application.
I created a configuration file with the name of "MyProjectName.exe.config".
I loaded the following configuration information into the file:
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<appSettings>
<add key="ConnectStr"
value="MyConnectionString />
<add key="DataBase"
value="VideoStore"/>
<add key="DbOwner"
value="jheavey"/>

</appSettings>
</configuration>

I attempted to access the configuration file in the same manner as I would
in a "VB" Application, but it did not like the format, so I added the
"get" method, but nothing comes back, what am I doing wrong?

Here is my code...

private string connString =
System.Configuration.ConfigurationSettings.AppSett ings.Get("ConnectStr");

Thanks in advance for your assistance!!!!!!!!

Nov 15 '05 #2

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

Similar topics

10
by: Captain Ranger McCoy | last post by:
Hello! Suppose I have ten servers at ten ips: x.x.x.1 x.x.x.2 x.x.x.3 x.x.x.4 and so on Each server hosts 100+ photo galleries, all under a single domain name,
3
by: Zdenda | last post by:
Hi, i have RH9 and i need python 2.3. I executed tgz file and typed ./configue. Then i type make. It is without problem. When I type make install ... .... .... Compiling...
1
by: Maxim. V. | last post by:
Hello to everone, As mentioned in this *guide(1), i've compiled mysql on my fedora Core 2 system, with the following spec's : *(1) http://hulan.info/blog/index.php?itemid=576 ...
9
by: James Macbell | last post by:
I think I have pushed ASP.NET to the limit, I am not sure if I have done anything wrong in the code because I am trying to make 2 pieces of code (C# vs PHP) using the same algorithm. Anyways, here...
5
by: Samuel | last post by:
Can someone please help me install php on apache? I downloaded the latest stable msi installer. Left it with default options unless i specifically needed to change them (e.g. server). Then I went...
2
by: athos | last post by:
Hi All, We are using a DTS in SQL Server 2000 (will turn to 2005 soon, if anything ad hoc may help) to import data periodically from a folder. Now the problem is, if the filename is fixed. It...
2
by: flapski | last post by:
How do i configue my ports on my router as it is limiting the gear i can download?
8
by: coolminded | last post by:
hi, i'm using vb6 as a front end and postgresql 8.0.0 as a backend. i just configured the pg_hba.conf file. i changed the method to "md5" and in the database, i gave the name of database. but when...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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: 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...
0
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,...
0
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...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
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...
0
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...

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.