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(ServerInfo serverInfo, SqlInternalConnectionTds connHandler, Boolean ignoreSniOpenTimeout, Int64 timerExpire, Boolean encrypt, Boolean trustServerCert, Boolean integratedSecurity, SqlConnection owningObject)
at System.Data.SqlClient.SqlInternalConnectionTds.AttemptOneLogin(ServerInfo serverInfo, String newPassword, Boolean ignoreSniOpenTimeout, Int64 timerExpire, SqlConnection owningObject)
at System.Data.SqlClient.SqlInternalConnectionTds.LoginNoFailover(String host, String newPassword, Boolean redirectedUserInstance, SqlConnection owningObject, SqlConnectionString connectionOptions, Int64 timerStart)
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()
Click "Mark as Answer" on the post that helped you.
This earns you a point and marks your thread as Resolved so we will all know you have been helped.
FAQ on the correct forum http://forums.asp.net/p/1337412/2699239.aspx#2699239
You should investigate what the connection string should be like:
1) Create an empty text file in windows explorer and rename it to X.UDL
2) Double click on it and the datalink provider dialog will appear.
3) Select the provider tab. Find the provider for SQL Server and click next.
4) Select your database and select integrated authentication.
5) Test the connection and save it.
6) Compare the contents of X.UDL with your connections string.
You could try looking on http://www.connectionstrings.com/ for a SQL Express example.
Click "Mark as Answer" on the post that helped you.
This earns you a point and marks your thread as Resolved so we will all know you have been helped.
FAQ on the correct forum http://forums.asp.net/p/1337412/2699239.aspx#2699239
3 Do not see SQL server express but only see SQL server
4 No list appears
The lack of list is disturbing - I suggest you setting up an X.UDL on a working development machine.
Click "Mark as Answer" on the post that helped you.
This earns you a point and marks your thread as Resolved so we will all know you have been helped.
FAQ on the correct forum http://forums.asp.net/p/1337412/2699239.aspx#2699239
kenbati
Member
234 Points
408 Posts
Re: OBJECT REFERENCE NOT SET TO AN INSTANCE OF AN OBJECT
Jul 11, 2008 01:35 AM|LINK
When I run this aspnet_regsql
I get the following error
etup 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(ServerInfo serverInfo, SqlInternalConnectionTds connHandler, Boolean ignoreSniOpenTimeout, Int64 timerExpire, Boolean encrypt, Boolean trustServerCert, Boolean integratedSecurity, SqlConnection owningObject)
at System.Data.SqlClient.SqlInternalConnectionTds.AttemptOneLogin(ServerInfo serverInfo, String newPassword, Boolean ignoreSniOpenTimeout, Int64 timerExpire, SqlConnection owningObject)
at System.Data.SqlClient.SqlInternalConnectionTds.LoginNoFailover(String host, String newPassword, Boolean redirectedUserInstance, SqlConnection owningObject, SqlConnectionString connectionOptions, Int64 timerStart)
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()
Our economy is bad due to corruption and monoply!
kenbati
Member
234 Points
408 Posts
Re: OBJECT REFERENCE NOT SET TO AN INSTANCE OF AN OBJECT
Jul 13, 2008 03:33 PM|LINK
Do we have any one from ms on this forum to help me?
Our economy is bad due to corruption and monoply!
TATWORTH
All-Star
72415 Points
14017 Posts
MVP
Re: OBJECT REFERENCE NOT SET TO AN INSTANCE OF AN OBJECT
Jul 13, 2008 06:50 PM|LINK
I need some more background
This earns you a point and marks your thread as Resolved so we will all know you have been helped.
FAQ on the correct forum http://forums.asp.net/p/1337412/2699239.aspx#2699239
TATWORTH
All-Star
72415 Points
14017 Posts
MVP
Re: OBJECT REFERENCE NOT SET TO AN INSTANCE OF AN OBJECT
Jul 13, 2008 06:53 PM|LINK
You should investigate what the connection string should be like:
1) Create an empty text file in windows explorer and rename it to X.UDL
2) Double click on it and the datalink provider dialog will appear.
3) Select the provider tab. Find the provider for SQL Server and click next.
4) Select your database and select integrated authentication.
5) Test the connection and save it.
6) Compare the contents of X.UDL with your connections string.
You could try looking on http://www.connectionstrings.com/ for a SQL Express example.
This earns you a point and marks your thread as Resolved so we will all know you have been helped.
FAQ on the correct forum http://forums.asp.net/p/1337412/2699239.aspx#2699239
kenbati
Member
234 Points
408 Posts
Re: OBJECT REFERENCE NOT SET TO AN INSTANCE OF AN OBJECT
Jul 14, 2008 05:34 PM|LINK
1 ok
2 ok
3 Do not see SQL server express but only see SQL server
4 No list appears
I am using VWD 2005 express with ms sql express
Our economy is bad due to corruption and monoply!
kenbati
Member
234 Points
408 Posts
Re: OBJECT REFERENCE NOT SET TO AN INSTANCE OF AN OBJECT
Jul 14, 2008 05:35 PM|LINK
1 ok
2 ok
3 Do not see SQL server express but only see SQL server
4 No list appears
I am using VWD 2005 express with ms sql express,
Our economy is bad due to corruption and monoply!
kenbati
Member
234 Points
408 Posts
Re: OBJECT REFERENCE NOT SET TO AN INSTANCE OF AN OBJECT
Jul 14, 2008 05:37 PM|LINK
ms window xp with uptodate service and security packs
Our economy is bad due to corruption and monoply!
TATWORTH
All-Star
72415 Points
14017 Posts
MVP
Re: OBJECT REFERENCE NOT SET TO AN INSTANCE OF AN OBJECT
Jul 14, 2008 05:43 PM|LINK
The lack of list is disturbing - I suggest you setting up an X.UDL on a working development machine.
This earns you a point and marks your thread as Resolved so we will all know you have been helped.
FAQ on the correct forum http://forums.asp.net/p/1337412/2699239.aspx#2699239
kenbati
Member
234 Points
408 Posts
Re: OBJECT REFERENCE NOT SET TO AN INSTANCE OF AN OBJECT
Jul 14, 2008 06:36 PM|LINK
Shoudl I see SQL SERVER EXPRESS IN THE LIST??
ALL I AM USING IS MY PC FOR DEVELOPMENT
Our economy is bad due to corruption and monoply!
chetan.sarod...
All-Star
65709 Points
11133 Posts
Re: OBJECT REFERENCE NOT SET TO AN INSTANCE OF AN OBJECT
Jul 15, 2008 03:42 AM|LINK
Open "SQL Server Surface Area Configuration"
then opne the "Surface Area Configuartion for Services and Connections "
Under the Remote connection u have to enable the "Using both TCP/IP and Named Pipes "
then It will work..
Try to set Data Source= "serverName" in you connectionString
Data Source=.\SQLEXPRESS will work only on local m/c, It will not work if you host your site
Senior Software Engineer,
Approva Systems Pvt Ltd, Pune, India.