Ureader.com  
Microsoft software help and Community
   home   |   control panel login   |   archive   |  
 
DotNet
acad.assignment.mngr
academic
adonet
aspnet
aspnet.announcements
aspnet.build.controls
aspnet.caching
aspnet.datagridcontrol
aspnet.mobile
aspnet.security
aspnet.webcontrols
aspnet.webservices
clr
compactframework
component_services
datatools
distributed_apps
drawing
faqs
framework
framework.wmi
general
internationalization
interop
languages.csharp
languages.jscript
languages.vb
languages.vb.controls
languages.vb.data
languages.vb.upgrade
languages.vc
languages.vc.libraries
myservices
odbcnet
performance
remoting
scripting
sdk
security
setup
vjsharp
vsa
webservi.enhancements
webservices
windowsforms
windowsforms.controls
winforms.databinding
winforms.designtime
xml
  
 
date: Mon, 7 Jul 2008 14:23:05 -0700,    group: microsoft.public.dotnet.framework.windowsforms        back       


getting the connectionstring from app.config   
Hi, I have a windows forms c#.net app and I want to get the connection string 
from my app.config file which is shown below:

how do I achieve this

Thanx in advance
Robert

<configuration>
    <configSections>
    </configSections>
    <connectionStrings>
        <add name="DataAccess.Properties.Settings.MARSConnectionString"
            connectionString="Data Source=LON-OXBRD01;Initial 
Catalog=MARS;Integrated Security=True"
            providerName="System.Data.SqlClient" />
    </connectionStrings>
</configuration>
date: Mon, 7 Jul 2008 14:23:05 -0700   author:   Robert Smith

Re: getting the connectionstring from app.config   
"Robert Smith"  schrieb:
> Hi, I have a windows forms c#.net app and I want to get the connection 
> string
> from my app.config file which is shown below:
>
> <configuration>
>    <configSections>
>    </configSections>
>    <connectionStrings>
>        <add name="DataAccess.Properties.Settings.MARSConnectionString"
>            connectionString="Data Source=LON-OXBRD01;Initial
> Catalog=MARS;Integrated Security=True"
>            providerName="System.Data.SqlClient" />
>    </connectionStrings>
> </configuration>

'Properties.Settings.Default.MARSConnectionString'.

-- 
 M S   Herfried K. Wagner
M V P  <URL:http://dotnet.mvps.org/>
 V B   <URL:http://dotnet.mvps.org/dotnet/faqs/>
date: Mon, 7 Jul 2008 23:42:45 +0200   author:   Herfried K. Wagner [MVP]

Google
 
Web ureader.com


    COPYRIGHT 2007, YARDI TECHNOLOGY LIMITED, ALL RIGHT RESERVE  |   contact us