Wrox Programmer Forums
Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 4 > ASP.NET 4 General Discussion
|
ASP.NET 4 General Discussion For ASP.NET 4 discussions not relating to a specific Wrox book
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 4 General Discussion section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old June 25th, 2011, 02:54 AM
Registered User
 
Join Date: Jan 2011
Posts: 6
Thanks: 1
Thanked 0 Times in 0 Posts
Default Server Error in asp.net application

My ASP.NET application runs perfectly on the Development server but when I try to deploy it to the local IIS server or a free hosting provider server, it turns with an unhandled exception in both cases an the error in the latter case being:

A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified)

I've spent days trying to sort out this problem but every where it asks for checking the remote login connections.In spite of all that, the error turns out again and again. Please help.
 
Old June 25th, 2011, 06:26 AM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Hi there,

Can you provide the following information:

1. OS of the web server
2. Name of the instance of the SQL Server installation (e.g. the name your hosts tells you to use to connect to it)
3. Your connection string
4. The location and code that gives you this error (e.g. in all your pages, or in pages using services like Membership; a stack trace would help).

Cheers,

Imar
__________________
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Follow me on Twitter

Author of Beginning ASP.NET 4.5 : in C# and VB, Beginning ASP.NET Web Pages with WebMatrix
and Beginning ASP.NET 4 : in C# and VB.
Did this post help you? Click the button below this post to show your appreciation!
 
Old June 25th, 2011, 07:39 AM
Registered User
 
Join Date: Jan 2011
Posts: 6
Thanks: 1
Thanked 0 Times in 0 Posts
Default Thanks for reply

1. I have SQL Web Server 2008 R2
2.my instance name is SQLEXPRESS1

3.The connection string name is BlogEntryConnectionString, BlogEntry being name of the blog database, and the connection string being: "Data Source=ANANT-PC\SQLEXPRESS1;Initial Catalog=BlogEntry;Integrated Security=True" providerName="System.Data.SqlClient"
ANANT-PC is the name of the machine.

4. The error doesn't arise when I run the code on development server but on the local server or the server of the hosting provider. It is related to permissions accessed by the database.
On the local server, the following exception arises:
A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server)
and the stack trace:
System.Data.SqlClient.SqlInternalConnection.OnErro r(SqlException exception, Boolean breakConnection) +308
System.Data.SqlClient.TdsParser.ThrowExceptionAndW arning() +412
System.Data.SqlClient.TdsParser.Connect(ServerInfo serverInfo, SqlInternalConnectionTds connHandler, Boolean ignoreSniOpenTimeout, Int64 timerExpire, Boolean encrypt, Boolean trustServerCert, Boolean integratedSecurity) +456
System.Data.SqlClient.SqlInternalConnectionTds.Att emptOneLogin(ServerInfo serverInfo, String newPassword, Boolean ignoreSniOpenTimeout, TimeoutTimer timeout, SqlConnection owningObject) +275
System.Data.SqlClient.SqlInternalConnectionTds.Log inNoFailover(ServerInfo serverInfo, String newPassword, Boolean redirectedUserInstance, SqlConnection owningObject, SqlConnectionString connectionOptions, TimeoutTimer timeout) +1076
System.Data.SqlClient.SqlInternalConnectionTds.Ope nLoginEnlist(SqlConnection owningObject, TimeoutTimer timeout, SqlConnectionString connectionOptions, String newPassword, Boolean redirectedUserInstance) +309
System.Data.SqlClient.SqlInternalConnectionTds..ct or(DbConnectionPoolIdentity identity, SqlConnectionString connectionOptions, Object providerInfo, String newPassword, SqlConnection owningObject, Boolean redirectedUserInstance) +350
System.Data.SqlClient.SqlConnectionFactory.CreateC onnection(DbConnectionOptions options, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningConnection) +509
System.Data.ProviderBase.DbConnectionFactory.Creat ePooledConnection(DbConnection owningConnection, DbConnectionPool pool, DbConnectionOptions options) +49
System.Data.ProviderBase.DbConnectionPool.CreateOb ject(DbConnection owningObject) +984
System.Data.ProviderBase.DbConnectionPool.UserCrea teRequest(DbConnection owningObject) +91
System.Data.ProviderBase.DbConnectionPool.GetConne ction(DbConnection owningObject) +1908
System.Data.ProviderBase.DbConnectionFactory.GetCo nnection(DbConnection owningConnection) +85
System.Data.ProviderBase.DbConnectionClosed.OpenCo nnection(DbConnection outerConnection, DbConnectionFactory connectionFactory) +270
System.Data.SqlClient.SqlConnection.Open() +299

In case of http://www.aspspider.info/anant718:
A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified)
Stack trace:
System.Data.SqlClient.SqlInternalConnection.OnErro r(SqlException exception, Boolean breakConnection) +5009598
System.Data.SqlClient.TdsParser.ThrowExceptionAndW arning() +234
System.Data.SqlClient.TdsParser.Connect(ServerInfo serverInfo, SqlInternalConnectionTds connHandler, Boolean ignoreSniOpenTimeout, Int64 timerExpire, Boolean encrypt, Boolean trustServerCert, Boolean integratedSecurity) +341
System.Data.SqlClient.SqlInternalConnectionTds.Att emptOneLogin(ServerInfo serverInfo, String newPassword, Boolean ignoreSniOpenTimeout, TimeoutTimer timeout, SqlConnection owningObject) +129
System.Data.SqlClient.SqlInternalConnectionTds.Log inNoFailover(ServerInfo serverInfo, String newPassword, Boolean redirectedUserInstance, SqlConnection owningObject, SqlConnectionString connectionOptions, TimeoutTimer timeout) +239
System.Data.SqlClient.SqlInternalConnectionTds.Ope nLoginEnlist(SqlConnection owningObject, TimeoutTimer timeout, SqlConnectionString connectionOptions, String newPassword, Boolean redirectedUserInstance) +195
System.Data.SqlClient.SqlInternalConnectionTds..ct or(DbConnectionPoolIdentity identity, SqlConnectionString connectionOptions, Object providerInfo, String newPassword, SqlConnection owningObject, Boolean redirectedUserInstance) +232
System.Data.SqlClient.SqlConnectionFactory.CreateC onnection(DbConnectionOptions options, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningConnection) +185
System.Data.ProviderBase.DbConnectionFactory.Creat ePooledConnection(DbConnection owningConnection, DbConnectionPool pool, DbConnectionOptions options) +33
System.Data.ProviderBase.DbConnectionPool.CreateOb ject(DbConnection owningObject) +524
System.Data.ProviderBase.DbConnectionPool.UserCrea teRequest(DbConnection owningObject) +66
System.Data.ProviderBase.DbConnectionPool.GetConne ction(DbConnection owningObject) +479
System.Data.ProviderBase.DbConnectionFactory.GetCo nnection(DbConnection owningConnection) +108
System.Data.ProviderBase.DbConnectionClosed.OpenCo nnection(DbConnection outerConnection, DbConnectionFactory connectionFactory) +126
System.Data.SqlClient.SqlConnection.Open() +125

Please try to sort this out.It will be a great help to me.Thank you so much!
 
Old June 25th, 2011, 07:55 AM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Quote:
The error doesn't arise when I run the code on development server but on the local server or the server of the hosting provider.

and
Quote:
2.my instance name is SQLEXPRESS1
Does this mean you're trying to connect to ANANT-PC\SQLEXPRESS1 from your site running with your host? That's not going to work; first of all because ANANT-PC is a local name, and secondly because of firewall issues.

When you host your site with an hoster, they typically give you access to a SQL Server and provide details to connect to it.

Cheers,

Imar
__________________
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Follow me on Twitter

Author of Beginning ASP.NET 4.5 : in C# and VB, Beginning ASP.NET Web Pages with WebMatrix
and Beginning ASP.NET 4 : in C# and VB.
Did this post help you? Click the button below this post to show your appreciation!
 
Old June 28th, 2011, 01:01 AM
Registered User
 
Join Date: Jan 2011
Posts: 6
Thanks: 1
Thanked 0 Times in 0 Posts
Default Another issue

Hello Sir,
Now an another issue has arrived and this may be not that difficult to solve.I noticed it right now.When I run the app even on the development server and the localhost, the page which doesn't require a login opens perfectly with the data list but the page that should open after entering the correct credentials in the login page dosent open and shows the same error-40 stated in the previous post.
Earlier, the app worked fine in the development server and didnt work at all in the localhost. But now it works partially in both development and localhost servers. This may be due to the change in settings that I must have done in order to find a solution.





Similar Threads
Thread Thread Starter Forum Replies Last Post
Deploying Asp.net application on Production server Nabeel82 ASP.NET 2.0 Professional 1 March 20th, 2009 06:17 PM
How to deploy ASP.NET application on server maz_alaameri ASP.NET 2.0 Professional 22 August 27th, 2007 03:54 PM
Error Message: Asp.Net Server failed to start ... ramakrishna.one .NET Framework 2.0 0 June 9th, 2007 03:23 AM
Moving an asp.net application to server douganders VB.NET 2002/2003 Basics 3 May 13th, 2005 02:54 PM
"Server not running ASP.NET 1.1" error message arashj General .NET 1 September 7th, 2004 05:49 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.