Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
angelran
Starting Member
7 Posts |
Posted - 2005-12-04 : 10:03:42
|
| hi all,i installed sql server 2005 express on my machine, but i cannot configure the database by using aspnet_regsql.exe, it tells me cannot connect to the server, i use win xp sp2, anyone can help me out? here is the fault detail:Setup failed.Exception:Unable to connect to SQL Server database.----------------------------------------Details of failure----------------------------------------System.Web.HttpException: Unable to connect to SQL Server database. ---> System.Data.SqlClient.SqlException: An error has occurred while establishing a connection to the server. When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server) at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection) at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj) at System.Data.SqlClient.TdsParser.Connect(Boolean& useFailoverPartner, Boolean& failoverDemandDone, String host, String failoverPartner, String protocol, SqlInternalConnectionTds connHandler, Int64 timerExpire, Boolean encrypt, Boolean trustServerCert, Boolean integratedSecurity, SqlConnection owningObject, Boolean aliasLookup) at System.Data.SqlClient.SqlInternalConnectionTds.OpenLoginEnlist(SqlConnection owningObject, SqlConnectionString connectionOptions, String newPassword, Boolean redirectedUserInstance) at System.Data.SqlClient.SqlInternalConnectionTds..ctor(DbConnectionPoolIdentity identity, SqlConnectionString connectionOptions, Object providerInfo, String newPassword, SqlConnection owningObject, Boolean redirectedUserInstance) at System.Data.SqlClient.SqlConnectionFactory.CreateConnection(DbConnectionOptions options, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningConnection) at System.Data.ProviderBase.DbConnectionFactory.CreatePooledConnection(DbConnection owningConnection, DbConnectionPool pool, DbConnectionOptions options) at System.Data.ProviderBase.DbConnectionPool.CreateObject(DbConnection owningObject) at System.Data.ProviderBase.DbConnectionPool.UserCreateRequest(DbConnection owningObject) at System.Data.ProviderBase.DbConnectionPool.GetConnection(DbConnection owningObject) at System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection owningConnection) at System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory) at System.Data.SqlClient.SqlConnection.Open() at System.Web.Management.SqlServices.GetSqlConnection(String server, String user, String password, Boolean trusted, String connectionString) --- End of inner exception stack trace --- at System.Web.Management.SqlServices.GetSqlConnection(String server, String user, String password, Boolean trusted, String connectionString) at System.Web.Management.SqlServices.SetupApplicationServices(String server, String user, String password, Boolean trusted, String connectionString, String database, String dbFileName, SqlFeatures features, Boolean install) at System.Web.Management.SqlServices.Install(String database, SqlFeatures features, String connectionString) at System.Web.Management.ConfirmPanel.Execute()cheers |
|
|
jim_a_fisher
Starting Member
2 Posts |
Posted - 2005-12-12 : 13:53:13
|
| I am running SQL Server 2005 Enterprise Edition, and I hit the same snag as above when running the aspnet_regsql.exe program.These are the steps to get around the problem for SQL Server 2005 Enterprise Edition (the same steps should work for SQL Server 2005 Express Edition assuming that you have the tools installed on your machine): - Open the "SQL Server Configuration Manager" (under Configuration Tools) - Expand the "SQL Server 2005 Network Configuration" - Select the "Protocols for <instance_name>" - Set the Named Pipes To Enabled - Not sure if this is needed, but it warns you that the change will not take place until the SQL Server 2005 Service is restarted - Close the "SQL Server Configuration Manager" - Once I restarted the SQL Server 2005 Service, I re-ran the aspnet_regsql.exe program and it was able to create the database |
 |
|
|
jim_a_fisher
Starting Member
2 Posts |
Posted - 2005-12-22 : 16:50:03
|
| Update to my original post: I had to set up a new machine with Windows XP SP2 with just SQLExpress on it and found a new wrinkle.I ran into the same error message about the Named Pipes, and used the solution I outlined above. After restarting the SQL Server 2005 SQLEXPRESS instance, I was still getting the same error.It turns out that the error message is really saying that it cannot reach the SQLExpress instance at all. If you have just SQLExpress installed, you can test this by going to the screen that has the "Server" line on it. By default, this line will just read {Machine_Name}. If you click the down arrow next to the Database line, and the "Server" line is just the {Machine_Name}, you should get the following error: "Failed to query a list of database names from the SQL server."However, if you click "OK", change the "Server" line to read {Machine_Name}\{SQLExpress_Instance_Name}, and then click the down arrow next to the Database line, you should get a list of the databases under the SQLExpress instance.If you keep <default>, then click Next, and then Next again, the aspnetdb database should be created.Hope that helps. |
 |
|
|
jasoncashel
Starting Member
1 Post |
Posted - 2006-01-15 : 09:41:26
|
| Just to add to this I was getting the above error as well when I ran: aspnet_regsql.exe -E -S Localhost -A mrp -d DBNAmebut it was fixed when I ran:aspnet_regsql.exe -E -S PC\SQLEXPRESS -A mrp -d DBNAmewhere PC is my computer name and SQLEXPRESS is the instance.Jason |
 |
|
|
dbedo
Starting Member
1 Post |
Posted - 2007-06-04 : 20:30:44
|
| Thanks fisher your solution worked for me ... I was pulling my hair out trying to figure it out.!! |
 |
|
|
anjanmaity
Starting Member
1 Post |
Posted - 2008-06-02 : 09:30:23
|
| I am checked all of options mentions here , yet i am geting the same error.Please help me if something another I missed out.anjanmaity |
 |
|
|
martinoosthuizen
Starting Member
1 Post |
Posted - 2008-06-10 : 16:50:27
|
| anjanmaity, Your problem could be that you're running SQL Express without a functional IIS instance, which means that localhost (or any server name) will not work. To reach the instance of SQL Express, you could use something like this:<add name="YourConnStringName" connectionString="Data Source=.\SQLEXPRESS; Initial Catalog=DatabaseName; Persist Security Info=True; User ID=user; Password=password" providerName="System.Data.SqlClient"/> |
 |
|
|
|
|
|
|
|