Coloque no arquivo de configuração web.config apos a tag <configuration>
<connectionStrings>
<add name="conn" connectionString="Data Source=.\SQLEXPRESS;User ID=seu_usuario;Initial Catalog=seu_banco;pwd=sua_senha" providerName="System.Data.SqlClient"/>
</connectionStrings>
E no projeto desta forma:
use os namespaces
Imports System.Data
Imports System.Data.SqlClient
E abaixo uma rotina de como abrir e fechar uma conexão
Protected Sub GetConexao()
Dim strConn As String = System.Configuration.ConfigurationManager.ConnectionStrings("conn").ConnectionString
Dim conn As New SqlConnection(strConn)
conn.Open()
'rotinas
conn.Close()
conn.Dispose()
End Sub
msn: poseidonfba@hotmail.com