This is the connection string that gets generated with the “New ASP.Net Website” template in vs 2010
<connectionStrings>
<add name="ApplicationServices"
connectionString="data source=.SQLEXPRESS;Integrated Security=SSPI;AttachDBFilename=|DataDirectory|aspnetdb.mdf;User Instance=true"
providerName="System.Data.SqlClient" />
I have a named instance of sql 2008 developer edition installed. I have changed the Server name but the query string will still not work. I want to be able to use the default db “aspnetdb.mdf”. I use Windows authentication to connect. How can i change the connection string to get this to work?
Answers:
Thank you for visiting the Q&A section on Magenaut. Please note that all the answers may not help you solve the issue immediately. So please treat them as advisements. If you found the post helpful (or not), leave a comment & I’ll get back to you as soon as possible.
Method 1
Attaching to a database via AttachDBFilename is only possible when you use one of the Express editions of the product. So it won’t work on the developer edition.
Since user instances will be removed in a future version of SQL Server, you probably shouldn’t use this.
All methods was sourced from stackoverflow.com or stackexchange.com, is licensed under cc by-sa 2.5, cc by-sa 3.0 and cc by-sa 4.0