肖恩D++
Not Equal C && !=C && 不等于西
-
Visual Studio Website Administration Tool & SQL Server Express
Posted on June 24th, 2010 1 commentIn Visual Studio the Website Administration Tool lets you view and manage the Web site configuration through a simple Web interface. But sometimes there is problem which is when using the Website Administration Tool to make a new connection for a new website, for example, using the security tab of the Website Administration Tool to manage rules for securing specific resources in the web application or website, it will display an error message “Unable to connect to SQL Server database”, even you have SQL Server Express installed and no problem to connect to it.
To solve this problem, try one or more of the following ways:
- Try A: Run ASP.NET SQL Server Setup Wizard
- 1. For VS2010, go to: Start -> All Programs -> Microsoft Visual Studio 2010 -> Visual Studio Tools -> Visual Studio Command Prompt (2010)
- 2. Type “aspnet_regsql.exe” to start the wizard
- 3. Click “Next” => choose “Configure SQL Server for application services”, click “Next” => enter your SQL Server name and instance name, choose “default” as database going to create, click “Next” => follow the wizard
(click pics for bigger view)
-
Try B: Clear user’s old database
- 1. Go to “C:\Users\[your user name]\AppData\Local\Microsoft\Microsoft SQL Server Data\” for Windows Vista or Windows 7, in XP go to “C:\Documents and Settings\[your user name]\Local
Settings\Application Data\Microsoft\Microsoft SQL Server Data\” - 2. Delete the folder “SQLEXPRESS”
- 3. Reboot PC
- 1. Go to “C:\Users\[your user name]\AppData\Local\Microsoft\Microsoft SQL Server Data\” for Windows Vista or Windows 7, in XP go to “C:\Documents and Settings\[your user name]\Local
-
Try C: Do this after failed on Try A
- 1. Go to “C:\Windows\Microsoft.NET\Framework\v2.0.50727\CONFIG\”
- 2. Find file machine.conf, open it
- 3. Find the line
1<add name="LocalSqlServer" connectionString="data source=.\SQLEXPRESS;Integrated Security=SSPI;AttachDBFilename=|DataDirectory|aspnetdb.mdf;User Instance=true" providerName="System.Data.SqlClient"/> - 4. Replace to (for SQL Server Express 2008)
1<add name="LocalSqlServer" connectionString="data source=.\SQLEXPRESS;Integrated Security=SSPI;AttachDBFilename=C:\Program Files\Microsoft SQL Server\MSSQL10_50.SQLEXPRESS\MSSQL\DATA\aspnetdb.mdf;User Instance=true" providerName="System.Data.SqlClient"/> - 5. Reboot the PC
- Try A: Run ASP.NET SQL Server Setup Wizard
Leave a Reply
1 Comment on "Visual Studio Website Administration Tool & SQL Server Express"
不错,听听