Adding a connection string to an appIn the web.config:
(this assumes SQL Server authentication)
Code:
<connectionStrings>
<add name="connectionname" connectionString="server=servername;database=databasename;user id=username;password=userpassword" providerName="System.Data.SqlClient"/>
</connectionStrings>
in the VB code:
Code:
Public Shared Function ConnectionString() As String
Dim cs As String = ConfigurationManager.ConnectionStrings("connectionname").ConnectionString
Return cs
End Function