I wiped that client machine and loaded Windows 7 64-bit and VS2008. Now my
VS solution cannot connect to the SQL Server. It times out.
I can access the database in question from VS2008 and retrieve via "Show
Table Data" from with Server Explorer.
So I am very confused. Can anyone help?
Thanks Charles
Connection string:
Data Source=POWDB;Initial Catalog=DbName;Persist Security Info=True;User
ID=user;Password=password
Error Message:
at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException
exception, Boolean breakConnection)
at
System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject
stateObj)
at
System.Data.SqlClient.TdsParserStateObject.ReadSniError(TdsParserStateObject
stateObj, UInt32 error)
at System.Data.SqlClient.TdsParserStateObject.ReadSni(DbAsyncResult
asyncResult, TdsParserStateObject stateObj)
at System.Data.SqlClient.TdsParserStateObject.ReadNetworkPacket()
at System.Data.SqlClient.TdsParser.ConsumePreLoginHandshake(Boolean encrypt,
Boolean trustServerCert, Boolean& marsCapable)
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 MailHouse.DataAccess.Client.GetEntityAll() in
E:\Development\Mailhouse\MailHouse.DataAccess\DB\Client.vb:line 282
at MailHouse.Forms.Login.Login_Load(Object sender, EventArgs e) in
E:\Development\Mailhouse\MailHouse.Forms\Login.vb:line 30
All there is in the error message is a stack dump. Wasn't there an actual
message?
But you can access the server from within Visual Studio. However, it
does not work from your application? I guess you need to compare the
connection string with the connection properties for what you have in
Server Explorer.
And if you can find the actual error message, post it.
--
Erland Sommarskog, SQL Server MVP, esq...@sommarskog.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/prodinfo/previousversions/books.mspx
The error occurs on opening a connection. I've included some more
information from the debugger. It's a timeout.
The connection string from Server Explorer is the same as I'm using in code.
I can connect to SQL Server 2008 using sqlcmd from the same machine which
runs VS2008! When I connect via sqlcmd, I use the same user/password.
Very confused.
Lars
Connection string:
Data Source=POWDB;Initial Catalog=DbName;Persist Security Info=True;User
ID=user;Password=password
From client machine running VS2008, which gets accurate output:
C:\>sqlcmd -SPOWDB -Uuser -Ppassword -dDbName -Q"select * from client;"
From client machine running VS2008, which gets accurate output:
C:\>sqlcmd -SPOWDB -Uuser -Ppassword -dDbName
1> EXEC dbo.usp_client_sel_all
2> go
From VS2008:
Timeout expired. The timeout period elapsed prior to completion of the
operation or the server is not responding.
Looping through the SqlException in a catch block:
A first chance exception of type 'System.Data.SqlClient.SqlException'
occurred in System.Data.dll
Index #0
Message: Timeout expired. The timeout period elapsed prior to completion of
the operation or the server is not responding.
LineNumber: 0
Source: .Net SqlClient Data Provider
Procedure:
From the SqlException:
ErrorCode -2146232060 Integer
Number -2 Integer
{System.Data.SqlClient.SqlCommand}
CommandText: "usp_Client_Sel_All"
CommandTimeout: 30
CommandType: StoredProcedure {4}
Connection: {System.Data.SqlClient.SqlConnection}
Container: Nothing
DesignTimeVisible: True
Notification: Nothing
NotificationAutoEnlist: True
Parameters: {System.Data.SqlClient.SqlParameterCollection}
Site: Nothing
Transaction: Nothing
UpdatedRowSource: Both {3}
"Erland Sommarskog" wrote:
> .
>
Does this stored procedure get called very early on in the lifetime of your
application? Are there other routines that are callled that are working?
I'm just wondering if this is a VS connection pooling issue - you can get
timeouts (albeit typically with a different error message that the below) if
you e.g. forget to close connections on SQLConnection objects.
"larzeb" <lar...@discussions.microsoft.com> wrote in message
news:CDE9EB6A-8D24-48F7...@microsoft.com...
> __________ Information from ESET NOD32 Antivirus, version of virus
> signature database 4652 (20091201) __________
>
> The message was checked by ESET NOD32 Antivirus.
>
> http://www.eset.com
>
>
>
__________ Information from ESET NOD32 Antivirus, version of virus signature database 4652 (20091201) __________
The message was checked by ESET NOD32 Antivirus.
I will have to admit that I'm stumped. Apparently something is not
what it seems to be.
The error message looks more like a command timeout to me, but the stack
dump indicates a connection problem.
I would use Profiler and include all Security Audit events, and see if
something turns up.
I'm seeing the same thing with 7x64, VS 2005 and SQL express 2005. I can
connect from the IDE but the application falis to connect remotelly via
TCP/IP. A local connection from the same application works just fine. The
rror is something like login failed or sever does not exist. Tryied running
both from VSHOST and complied.
Any help will be appreciated.
Ricardo
"Erland Sommarskog" wrote:
> .
>
--
__________________________________________________________________________
William R. Vaughn
President and Founder Beta V Corporation
Author, Mentor, Dad, Grandpa
Microsoft MVP
(425) 556-9205 (Pacific time)
Hitchhiker's Guide to Visual Studio and SQL Server (7th Edition)
http://betav.com http://betav.com/blog/billva
____________________________________________________________________________________________
"Ricardo Amaral" <Ricardo Ama...@discussions.microsoft.com> wrote in message
news:4700CB67-0A14-44BE...@microsoft.com...
Also make sure that the Browser service is running in SQL Server
Configuration Manager.
Also, as Bill says, you must also make sure you permit connections through
the firewall. This includes the TCP port on which SQL Server is running,
but also UDP port 1434 on which SQL Server Browser is listening.