When I click the Security
tab on the ASP.NET Web Site Administration Tool, I get this error.
"Unable to connect to SQL Server database.".
I'm using Visual Studio 2012
<configuration>
<connectionStrings>
<add name="devices" connectionString="Data Source=(LocalDB)\v11.0;AttachDbFilename=|DataDirectory|\devices.mdf;Integrated Security=True"
providerName="System.Data.SqlClient" />
<add name="users" connectionString="Data Source=(LocalDB)\v11.0;AttachDbfilename=|DataDirectory|\database.mdf;Integrated Security=True"
providerName="System.Data.SqlClient"/>
</connectionStrings>
<system.web>
<roleManager enabled="true" />
<compilation debug="true" targetFramework="4.5"/>
<httpRuntime targetFramework="4.5"/>
</system.web>
</configuration>
Data Source=(LocalDB)\v11.0;AttachDbFilename=|DataDirectory|\devices.mdf;Integrated Security=True
Looking at your data source. Does (LocalDB)\v11.0
exist and can you connect to the above DB?
If not that will be the reason....
I have found that every time I create a package for my website (For manual deployments), it overwrites my connection string in the package being created with the above data source.
This can be a blessing some times preventing your new website from launching. (Especially if its in the wrong environment. :)
http://www.connectionstrings.com/ This site is great for helping you creating connection strings for almost any DB.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With