dbTalk Databases Forums  

Error when connection to SQL Server Express

microsoft.public.sqlserver.setup microsoft.public.sqlserver.setup


Discuss Error when connection to SQL Server Express in the microsoft.public.sqlserver.setup forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Michel Vanderbeke
 
Posts: n/a

Default Error when connection to SQL Server Express - 04-19-2010 , 05:40 AM






Hello,

When trying to connect to my SQL Server Express 2008, I get the following
error:
Cannot connect to (local)

Error Number: 2
Severity: 20
State: 0

at System.Data.SqlClient.SqlInternalConnection.OnErro r(SqlException
exception, Boolean breakConnection)
at
System.Data.SqlClient.TdsParser.ThrowExceptionAndW arning(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.Att emptOneLogin(ServerInfo
serverInfo, String newPassword, Boolean ignoreSniOpenTimeout, Int64
timerExpire, SqlConnection owningObject)
at System.Data.SqlClient.SqlInternalConnectionTds.Log inNoFailover(String
host, String newPassword, Boolean redirectedUserInstance, SqlConnection
owningObject, SqlConnectionString connectionOptions, Int64 timerStart)
at
System.Data.SqlClient.SqlInternalConnectionTds.Ope nLoginEnlist(SqlConnection
owningObject, SqlConnectionString connectionOptions, String newPassword,
Boolean redirectedUserInstance)
at
System.Data.SqlClient.SqlInternalConnectionTds..ct or(DbConnectionPoolIdentity
identity, SqlConnectionString connectionOptions, Object providerInfo, String
newPassword, SqlConnection owningObject, Boolean redirectedUserInstance)
at
System.Data.SqlClient.SqlConnectionFactory.CreateC onnection(DbConnectionOptions
options, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection
owningConnection)
at
System.Data.ProviderBase.DbConnectionFactory.Creat eNonPooledConnection(DbConnection
owningConnection, DbConnectionPoolGroup poolGroup)
at
System.Data.ProviderBase.DbConnectionFactory.GetCo nnection(DbConnection
owningConnection)
at
System.Data.ProviderBase.DbConnectionClosed.OpenCo nnection(DbConnection
outerConnection, DbConnectionFactory connectionFactory)
at System.Data.SqlClient.SqlConnection.Open()
at
Microsoft.SqlServer.Management.SqlStudio.Explorer. ObjectExplorerService.ValidateConnection(UIConnect ionInfo
ci, IServerType server)
at
Microsoft.SqlServer.Management.UI.ConnectionDlg.Co nnector.ConnectionThreadUser()


How can I fix this error?

I remember that, when running setup, I choose 'Network' in stead of 'Local
System'. Could this cause the error? How can I change that?

Could you please help me to fix this?

Many thanks and greetings,

Michel

Reply With Quote
  #2  
Old   
Erland Sommarskog
 
Posts: n/a

Default Re: Error when connection to SQL Server Express - 04-19-2010 , 04:39 PM






Michel Vanderbeke (michel.vanderbeke (AT) skynet (DOT) be) writes:
Quote:
When trying to connect to my SQL Server Express 2008, I get the following
error:
Cannot connect to (local)
...
How can I fix this error?

I remember that, when running setup, I choose 'Network' in stead of 'Local
System'. Could this cause the error? How can I change that?

Could you please help me to fix this?
There are a number of things that can be wrong, but I shot from the hip
and say that you should try to specify "(local)\SQLEXPRESS" as the server,
since by default SQL Express is installed as a named instance with the
name SQLEXPRESS.

If that does not cut it, you need to give more details:
o What is your connection string?
o Is the client program running on the same machine as SQL Server?
o Can you connect with SQL Server Management Studio? SQLCMD?
o Etc.


--
Erland Sommarskog, SQL Server MVP, esquel (AT) sommarskog (DOT) se

Links for SQL Server Books Online:
SQL 2008: http://msdn.microsoft.com/en-us/sqlserver/cc514207.aspx
SQL 2005: http://msdn.microsoft.com/en-us/sqlserver/bb895970.aspx
SQL 2000: http://www.microsoft.com/sql/prodinf...ons/books.mspx

Reply With Quote
  #3  
Old   
Michel Vanderbeke
 
Posts: n/a

Default Re: Error when connection to SQL Server Express - 04-19-2010 , 06:11 PM



Hello,

"Erland Sommarskog" <esquel (AT) sommarskog (DOT) se> schreef in bericht
news:Xns9D5FF09AA775DYazorman (AT) 127 (DOT) 0.0.1...
Quote:
Michel Vanderbeke (michel.vanderbeke (AT) skynet (DOT) be) writes:
When trying to connect to my SQL Server Express 2008, I get the following
error:
Cannot connect to (local)
...
How can I fix this error?

I remember that, when running setup, I choose 'Network' in stead of
'Local
System'. Could this cause the error? How can I change that?

Could you please help me to fix this?

There are a number of things that can be wrong, but I shot from the hip
and say that you should try to specify "(local)\SQLEXPRESS" as the server,
since by default SQL Express is installed as a named instance with the
name SQLEXPRESS.

If that does not cut it, you need to give more details:
o What is your connection string?
o Is the client program running on the same machine as SQL Server?
o Can you connect with SQL Server Management Studio? SQLCMD?
It is with SQL Server Management Studio that I can not get a connection!

Many thanks for your response,

Michel

Reply With Quote
  #4  
Old   
Erland Sommarskog
 
Posts: n/a

Default Re: Error when connection to SQL Server Express - 04-20-2010 , 04:37 PM



Michel Vanderbeke (michel.vanderbeke (AT) skynet (DOT) be) writes:
Quote:
If that does not cut it, you need to give more details:
o What is your connection string?
o Is the client program running on the same machine as SQL Server?
o Can you connect with SQL Server Management Studio? SQLCMD?

It is with SQL Server Management Studio that I can not get a connection!
So did it help by specifying .\SQLEXPRESS for the instance name?


--
Erland Sommarskog, SQL Server MVP, esquel (AT) sommarskog (DOT) se

Links for SQL Server Books Online:
SQL 2008: http://msdn.microsoft.com/en-us/sqlserver/cc514207.aspx
SQL 2005: http://msdn.microsoft.com/en-us/sqlserver/bb895970.aspx
SQL 2000: http://www.microsoft.com/sql/prodinf...ons/books.mspx

Reply With Quote
  #5  
Old   
Michel Vanderbeke
 
Posts: n/a

Default Re: Error when connection to SQL Server Express - 04-22-2010 , 04:21 PM



Hello,

"Erland Sommarskog" <esquel (AT) sommarskog (DOT) se> schreef in bericht
news:Xns9D60F05C1E721Yazorman (AT) 127 (DOT) 0.0.1...
Quote:
Michel Vanderbeke (michel.vanderbeke (AT) skynet (DOT) be) writes:
If that does not cut it, you need to give more details:
o What is your connection string?
o Is the client program running on the same machine as SQL Server?
o Can you connect with SQL Server Management Studio? SQLCMD?

It is with SQL Server Management Studio that I can not get a connection!

So did it help by specifying .\SQLEXPRESS for the instance name?

Yes! That did the trick!

Thank you very much,

Michel

Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.