Dim rootWebConfig As System.Configuration.Configuration
rootWebConfig = System.Web.Configuration.WebConfigurationManager.OpenWebConfiguration("/MyWebSiteRoot")
Dim connString As System.Configuration.ConnectionStringSettings
If (rootWebConfig.ConnectionStrings.ConnectionStrings.Count > 0) Then
connString = rootWebConfig.ConnectionStrings.ConnectionStrings("NorthwindConnectionString")
If Not (connString.ConnectionString = Nothing) Then
Console.WriteLine("Northwind connection string = {0}", connString.ConnectionString)
Else
Console.WriteLine("No Northwind connection string")
End If
End If