Click here to Skip to main content
15,913,055 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hie!

I am using vb.net 2005 winapplication with ms access.
i am trying to make mi connectionstring global.
for that is put these lines of code in app.config.

XML
<connectionStrings>

    <add name="Test.My.MySettings.TransportConnectionString" connectionString="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=|DataDirectory|\Transport.mdb;"
    providerName="System.Data.OleDb" />


</connectionStrings>


but after that when i am calling this connectionstring in forms as per i know how to call i use this code.

dim st as string
st=system.configuration.configurationmanager.appsetting("name of connection string")

but this line not excute means when i am trying to write this code after

system.configuration. it will not display listitem for configurationmanager.


so please tell me how to call connectionstring from app.config file.
Posted

Try to use ConfigurationManager.ConnectionStrings instead of app settings as this is not added in app settings.

[UPDATE]
Your question is not at all clear. I assume you are asking for System.Configuration namespace. If so, check if you added reference to System.Configuration in your project.
 
Share this answer
 
v2
Comments
Npanchasara 15-Jul-10 1:45am    
u didnt understand mi question.
actaully when i type system.configuration. after this it wil display listitems but there is nothing like configurationnamager thats y i am asking this ?
what to do there?
To use configuration manager, you need to add the system.configuration.dll to your project
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900