Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Store Connection String - Part 2
Message
Information générale
Forum:
ASP.NET
Catégorie:
Code, syntaxe and commandes
Versions des environnements
Environment:
VB 9.0
OS:
Vista
Network:
Windows 2008 Server
Database:
MS SQL Server
Divers
Thread ID:
01359906
Message ID:
01359921
Vues:
27
>I found it. I had renamed it from "app.config" to "bm.config". Apparently .Net expects the name to be App.config.

It's certainly not keen on anything else :-)
FWIW, since you've just started using this you may as well use the System.Configuration.ConfigurationManager class instead since the other is 'obsolete'
Best,
Viv

>
>
>
>>>I right clicked on my project and selected Add->New, Application Configuration File.
>>>
>>>I added the following:
>>>
>>>
>>>add key="WorkConnString" value="Data Source=CIS-SI-OFFICE\SQLEXPRESS;Initial  catalog=BusMgr;Trusted_Connection=Yes"
>>>
>>>
>>>In my code I added:
>>>
>>>string sConnString = ConfigurationSettings.AppSettings["WorkConnString"];
>>>
>>>
>>>I get Null back.
>>>
>>>What am I doing wrong here???
>>
>>Hi,
>>Are you sure you put the key in the 'applicationSettings' section of the config file?
>>Also System.Configuration.ConfigurationSettings is marked as obsolete and been replaced by System.Configuration.ConfigurationManager (but this doesn't mean your version would not work)
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform