I am facing problem in using vb.net with sql server as DB.. Problem is of connection string i.e for \'n\' no. Of systems what shall be the connection string? App after geting de
Below is a VB.Net code snippet to retrieve a connection string from the app.config. The project will need a reference to System.Configuration in order to use the ConfigurationManager.
Dim connectionString As String=System.Configuration.ConfigurationManager.ConnectionStrings("myDatabase").ConnectionString
An example App.Config:
<configuration>
<connectionStrings>
<add name="myDatabase" connectionString="Data Source=MyServer;Initial Catalog=MyDatabase;Integrated Security=SSPI" />
</connectionStrings>
</configuration>