I was just trying out the code in
Introducing ASP.NET Web Part Connections and I immediately stumbled upon an error stating "System.Data.SqlClient.SqlException: An error has occurred while establishing a connection to the server." Fortunately I got to this great blogposting from
Scott Guttrie - important things to know:
Most of the ASP.NET 2.0 application services are configured to use the built-in SQL Express provider. Since I didn't install it ;-(If you want to use a different provider - you first need to create the SQL database scheam with the aspnet_regsql.exe utilityPoint your web application to the new DB in your web.config - just replace the connectionstring value for the "LocalSqlServer in the web apps web.config
e.g.
<connectionStrings>
<remove name=”LocalSqlServer”/>
<add name="LocalSqlServer" connectionString="Data Source=localhost;Initial Catalog=appservicesdb;Integrated Security=True" providerName="System.Data.SqlClient"/>
</connectionStrings>
No comments:
Post a Comment