Last post Dec 06, 2011 02:08 AM by dotnetnerd
Oct 22, 2011 11:16 PM|MichaelYarbrough1975|LINK
I have VS 2010 Express and SQL Server R2 Express. When I click on the Security tab in the Web Site Administration tool I'm getting "unable to connect to sql server database" It's an MVC 3 app. I was able to run the aspnet_regsql.exe to create the aspnetdb
database. In SQL Server properties/Security I've tried both "Windows Authentication mode" and "SQL Server and Windows Authentication mode" In SQL Server properties/Connections the "Allow remote connections to this server" is checked. Does anyone know what's
Oct 23, 2011 07:11 AM|Anindita.Basak|LINK
Please try out the following steps:
Looking at this closer, the connection string is using a user instance to a local database file, ASPNETDB.MDF. You should confirm that this file exists in your App_Data subdirectory of your web site. This connection string will just use that database file
for all operations.
If this still doesn't work, check to see if SQL Server Express is installed in a default way.
Oct 23, 2011 07:25 PM|MichaelYarbrough1975|LINK
I'm still getting "unable to connect to sql server database" when I click on the Security tab in ASP.NET Configuration tool. I tried changing the connectionstring in my web.config file to "data source=.\SQLEXPRESS;Integrated Security=SSPI;AttachDBFilename=|DataDirectory|\aspnetdb.mdf;User
Instance=true". The only difference was the \ in front of \aspnetdb.mdf but it didn't work. BTW An mdf wasn't created in the App_data folder because I can't connect to the database using the ASP.NET Configuration tool. The "SQL Server (SQLEXPRESS)" is running
in the Configuration Manager. VS 2010 doesn't have the type attribute (type="System.Web.Security.SqlMembershipProvider, System.Web, Version=18.104.22.168, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a") referenced in
http://weblogs.asp.net/scottgu/archive/2006/04/22/Always-set-the-_2200_applicationName_2200_-property-when-configuring-ASP.NET-2.0-Membership-and-other-Providers.aspx so I didn't add it. I was able to run the aspnet_regsql.exe to create the aspnetdb database.
Here's my web.config file connectionstring section.
<add name="ApplicationServices" connectionString="data source=.\SQLEXPRESS;Integrated Security=SSPI;AttachDBFilename=|DataDirectory|aspnetdb.mdf;User Instance=true" providerName="System.Data.SqlClient" />
Dec 04, 2011 05:40 AM|JAVDAC|LINK
I also get the same error on the security page, is there no help. Here is the whole message on the web page when I click on the security tab:
"There is a problem with your selected data store. This can be caused by an invalid server name or credentials, or by insufficient permission. It can also be caused by the role manager feature not being enabled. Click the button below to be redirected to a
page where you can choose a new data store.
The following message may help in diagnosing the problem:
Unable to connect to SQL Server database."
Now when I click on the "Choose Data Store" button, it takes me to the page where you can test the connection, but that fails also.
I have remoting on, According to some training material I have, this asp.net configuration tool is supposed to create a aspnetbd file into the app_data folder of the web project which doesn't happen.
Dec 05, 2011 08:20 PM|spiritedaway26|LINK
To test of you have an "insuficient permission" issue, you can grant temporary full control to EVERYONE (object name)
Dec 06, 2011 02:08 AM|dotnetnerd|LINK
Please see this thread, http://forums.asp.net/t/1088928.aspx/1. Good luck