locked
ASP.net newbie - Database Connection Problem - Personal Website Starter Kit RRS feed

  • Question

  • User623088345 posted

    Hi guys!

    I am pretty new to asp.net. I thought I'd start off with the personal website starter kit to introduce myself.

    Unfortunitly, I am having a problem trying to run it outside visual studio's localhost web server.

    I have tried many things to reslove this problem including reinstalling all the applications to run the site, resetting permissions such as 'Network Service' and 'ASPNET', reinstalling the website files, and continiously checking that sql server can allow remote connections as well as local ones.

    The following error occurs when I try to run the website remotely (http://home.waynedougan.me.uk): 


     

    Server Error in '/personal' Application.

    A connection was successfully established with the server, but then an error occurred during the login process. (provider: Named Pipes 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: Named Pipes Provider, error: 0 - No process is on the other end of the pipe.)

    Source Error:

    Line 5:  	Sub Application_Start(ByVal sender As [Object], ByVal e As EventArgs)
    Line 6:  		AddHandler SiteMap.SiteMapResolve, AddressOf Me.AppendQueryString
    Line 7:  		If (Roles.RoleExists("Administrators") = False) Then
    Line 8:  			Roles.CreateRole("Administrators")
    Line 9:  		End If

    Source File: c:\inetpub\wwwroot\personal\global.asax    Line: 7

    Stack Trace:

    [SqlException (0x80131904): A connection was successfully established with the server, but then an error occurred during the login process. (provider: Named Pipes Provider, error: 0 - No process is on the other end of the pipe.)]
       System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection) +739123
       System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj) +188
       System.Data.SqlClient.TdsParserStateObject.ReadSniError(TdsParserStateObject stateObj, UInt32 error) +556
       System.Data.SqlClient.TdsParserStateObject.ReadSni(DbAsyncResult asyncResult, TdsParserStateObject stateObj) +164
       System.Data.SqlClient.TdsParserStateObject.ReadPacket(Int32 bytesExpected) +34
       System.Data.SqlClient.TdsParserStateObject.ReadBuffer() +30
       System.Data.SqlClient.TdsParserStateObject.ReadByte() +17
       System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj) +79
       System.Data.SqlClient.SqlInternalConnectionTds.CompleteLogin(Boolean enlistOK) +33
       System.Data.SqlClient.SqlInternalConnectionTds.AttemptOneLogin(ServerInfo serverInfo, String newPassword, Boolean ignoreSniOpenTimeout, Int64 timerExpire, SqlConnection owningObject) +170
       System.Data.SqlClient.SqlInternalConnectionTds.LoginNoFailover(String host, String newPassword, Boolean redirectedUserInstance, SqlConnection owningObject, SqlConnectionString connectionOptions, Int64 timerStart) +349
       System.Data.SqlClient.SqlInternalConnectionTds.OpenLoginEnlist(SqlConnection owningObject, SqlConnectionString connectionOptions, String newPassword, Boolean redirectedUserInstance) +181
       System.Data.SqlClient.SqlInternalConnectionTds..ctor(DbConnectionPoolIdentity identity, SqlConnectionString connectionOptions, Object providerInfo, String newPassword, SqlConnection owningObject, Boolean redirectedUserInstance) +170
       System.Data.SqlClient.SqlConnectionFactory.CreateConnection(DbConnectionOptions options, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningConnection) +359
       System.Data.ProviderBase.DbConnectionFactory.CreatePooledConnection(DbConnection owningConnection, DbConnectionPool pool, DbConnectionOptions options) +28
       System.Data.ProviderBase.DbConnectionPool.CreateObject(DbConnection owningObject) +424
       System.Data.ProviderBase.DbConnectionPool.UserCreateRequest(DbConnection owningObject) +66
       System.Data.ProviderBase.DbConnectionPool.GetConnection(DbConnection owningObject) +496
       System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection owningConnection) +82
       System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory) +105
       System.Data.SqlClient.SqlConnection.Open() +111
       System.Web.DataAccess.SqlConnectionHolder.Open(HttpContext context, Boolean revertImpersonate) +84
       System.Web.DataAccess.SqlConnectionHelper.GetConnection(String connectionString, Boolean revertImpersonation) +197
       System.Web.Security.SqlRoleProvider.RoleExists(String roleName) +482
       System.Web.Security.Roles.RoleExists(String roleName) +242
       ASP.global_asax.Application_Start(Object sender, EventArgs e) in c:\inetpub\wwwroot\personal\global.asax:7
    


    Version Information: Microsoft .NET Framework Version:2.0.50727.832; ASP.NET Version:2.0.50727.832

     

    Can someone please please help me as I have been stuck with this for days and I am on the verge of reinstalling everything again only this time including the OS, after which I may give up.

    Regards,

    Wayne

    Windows Server 2003 Enterprise Edition,
    IIS 6.0, Visual Web Developer 2005 Express Edition, Microsoft SQL Server 2005

    Sunday, September 9, 2007 10:17 AM

All replies

  • User-319574463 posted

    First check 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 your data access method and click next.
    4) Select your source 
    5) Test the connection and save it.
    6) Compare the contents of X.UDL with your connections string.

    Once you know the connection string is correct try connecting using SQL Server Management Studio (or the Express equivalent) using that account.  Check that the expected stored procedures appear and then try running them. I suspect that the SQL account being used has incorrect permissions.

    Sunday, September 9, 2007 1:14 PM