Showing posts with label purposes. Show all posts
Showing posts with label purposes. Show all posts

Sunday, February 19, 2012

Cant connect to SQL Server 2005 with Pet Shop 4.0 : No process at other end of pipe?!

I downloaded MS Pet Shop 4.0 recently for best-practice training purposes. The installation went smoothly with a SQL Server 2005 backend. At first I had a problem authenticating the mspetshop4 user in the database, but that was solved by fixing some settings with the password policy. Now the mspetshop4 user is authenticated properly, but I came across this error instead:
Server Error in '/Web' Application.A connection was successfully established with the server, but then an error occurred during the login process. (provider: Shared Memory Provider, error: 0 - No process is on the other end of the pipe.)Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.Exception Details: System.Data.SqlClient.SqlException: A connection was successfully established with the server, but then an error occurred during the login process. (provider: Shared Memory Provider, error: 0 - No process is on the other end of the pipe.)Source Error:Line 216:Line 217: if (conn.State != ConnectionState.Open)Line 218: conn.Open();Line 219:Line 220: cmd.Connection = conn;Source File: C:\Program Files\Microsoft\.NET Pet Shop 4.0\DBUtility\SQLHelper.cs Line: 218Stack Trace:[SqlException (0x80131904): A connection was successfully established with the server, but then an error occurred during the login process. (provider: Shared Memory Provider, error: 0 - No process is on the other end of the pipe.)] System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection) +117 System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj) +346 System.Data.SqlClient.TdsParserStateObject.ReadSniError(TdsParserStateObject stateObj, UInt32 error) +619 System.Data.SqlClient.TdsParserStateObject.ReadSni(DbAsyncResult asyncResult, TdsParserStateObject stateObj) +224 System.Data.SqlClient.TdsParserStateObject.ReadPacket(Int32 bytesExpected) +113 System.Data.SqlClient.TdsParserStateObject.ReadBuffer() +59 System.Data.SqlClient.TdsParserStateObject.ReadByte() +36 System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj) +181 System.Data.SqlClient.SqlInternalConnectionTds.CompleteLogin(Boolean enlistOK) +56 System.Data.SqlClient.SqlInternalConnectionTds.OpenLoginEnlist(SqlConnection owningObject, SqlConnectionString connectionOptions, String newPassword, Boolean redirectedUserInstance) +1083 System.Data.SqlClient.SqlInternalConnectionTds..ctor(DbConnectionPoolIdentity identity, SqlConnectionString connectionOptions, Object providerInfo, String newPassword, SqlConnection owningObject, Boolean redirectedUserInstance) +272 System.Data.SqlClient.SqlConnectionFactory.CreateConnection(DbConnectionOptions options, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningConnection) +688 System.Data.ProviderBase.DbConnectionFactory.CreatePooledConnection(DbConnection owningConnection, DbConnectionPool pool, DbConnectionOptions options) +82 System.Data.ProviderBase.DbConnectionPool.CreateObject(DbConnection owningObject) +558 System.Data.ProviderBase.DbConnectionPool.UserCreateRequest(DbConnection owningObject) +126 System.Data.ProviderBase.DbConnectionPool.GetConnection(DbConnection owningObject) +651 System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection owningConnection) +160 System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory) +122 System.Data.SqlClient.SqlConnection.Open() +229 PetShop.DBUtility.SqlHelper.PrepareCommand(SqlCommand cmd, SqlConnection conn, SqlTransaction trans, CommandType cmdType, String cmdText, SqlParameter[] cmdParms) in C:\Program Files\Microsoft\.NET Pet Shop 4.0\DBUtility\SQLHelper.cs:218 PetShop.DBUtility.SqlHelper.ExecuteReader(String connectionString, CommandType cmdType, String cmdText, SqlParameter[] commandParameters) in C:\Program Files\Microsoft\.NET Pet Shop 4.0\DBUtility\SQLHelper.cs:127 PetShop.SQLServerDAL.Category.GetCategories() in C:\Program Files\Microsoft\.NET Pet Shop 4.0\SQLServer\Category.cs:27 PetShop.BLL.Category.GetCategories() in C:\Program Files\Microsoft\.NET Pet Shop 4.0\BLL\Category.cs:20 PetShop.Web.NavigationControl.BindCategories() in c:\Program Files\Microsoft\.NET Pet Shop 4.0\Web\Controls\NavigationControl.ascx.cs:53 PetShop.Web.NavigationControl.Page_Load(Object sender, EventArgs e) in c:\Program Files\Microsoft\.NET Pet Shop 4.0\Web\Controls\NavigationControl.ascx.cs:27 System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e) +31 System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +68 System.Web.UI.Control.OnLoad(EventArgs e) +88 System.Web.UI.Control.LoadRecursive() +74 System.Web.UI.Control.LoadRecursive() +158 System.Web.UI.BasePartialCachingControl.LoadRecursive() +61 System.Web.UI.Control.LoadRecursive() +158 System.Web.UI.Control.LoadRecursive() +158 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +3035Version Information: Microsoft .NET Framework Version:2.0.50727.42; ASP.NET Version:2.0.50727.42
Now I'm clueless. What does No process at the other end of the pipe mean?Check if SQL Server is configured to accept Local and Remote Connections (using tcp) in Surface Area Configuration Manager. Also, check to see if your SQL Server is configured to accept connections over both TCP/IP and named pipes.|||

Hi, quick searched on these forums and I found a post with excatly similar issue as yours, hope this helpsSmile:

http://forums.asp.net/thread/1072499.aspx

Thursday, February 16, 2012

Can't connect to SQL Express 2005

I have a web app running on a laptop (for demo purposes) with the following connect string:

"datasource=<machine name>\SQLExpress;initial catalog=BlueTarp;User ID=sa;Password=xxx"

I can connect to this instance using both oSQL or sqlcmd and can select from the tables within BlueTarp, but my web app won't connect, and I can't figure out why!!

When I installed SQL Express, I used a named instance, called "SQLExpress".

I'm using mixed mode authentication.

One strange thing is that I can connect to either SQLExpress or MSSQLSERVER instances, but they appear to be the same instance -- I can use bluetarp in both.

when I use SQLExpress for instance name in web.config I get "SQL Server does not exist or access denied"

when I use MSSQLServer for instance name in web.config I get "Invalid connection"

And in fiddling with the web.config, I somehow did something to get a machine.config error, something like "machine.config couldn't be loaded because of an unloaded appdomain".

It's driving me nuts because I've spent a good 40 hours on this stupid problem, throwing the whole margin down the toilet.

Does anyone have any ideas?

Thank you,

Aarron

First, SQL Server has support for multiple protocols for remote connections (shared memory, named pipes, tcp/ip, and via) and if the client is trying a protocol the server has disabled then it will fail to connect.

To see what protocols are enabled, goto Computer Management -> SQL Server Configuration Manager -> SQL Server 2005 Network Configuration -> Protocols for <Instance Name>. If you change the protocols the server supports, you will need to restart the server.

Try using a protocol such as named pipes instead of shared memory. Try np:<machine name>.

http://msdn2.microsoft.com/en-US/library/system.data.sqlclient.sqlconnection.connectionstring(VS.80).aspx

For general troubleshooting of .NET connectivity issues, see this blog entry: http://blogs.msdn.com/sql_protocols/archive/2005/12/22/506607.aspx

For the ASP.NET issue, try restarting IIS/ASP.NET, and make sure machine.config is valid xml with the XML editor in Visual Studio.

|||

Mark,

Thanks so much for your help. I've been all over the web trying to find info about this problem -- people have pointed me to Mcaffe, to the .NET frameworks possibly having issues, to my web.config being poorly formatted.... and it turns out that I wasn't using a supported protocol. I enabled named pipes and it works like a charm.

You da man!

Aarron