开发者

ASP.NET application - Error when trying to connect to a SQL Server 2008 instance

Despite that I’m a regular reader of this great forum, this is my first post on it. I believe that this community can help me with the following problem that I have. I’m trying to publish an ASP.NET website over an IIS 6.0 (Windows 2003 Server), and I have some troubles trying to connect to the database. Curiously, I have installed another ASP.NET website into the same IIS 6.0 with the same properties and security parameters and can connect without problems with the same database. The application that works fine is almost the same that the one that can’t connect with SQL Server (actually is the same but with several modifications). I’ll enumarate some information related to the problem:

  • S.O: Windows 2003 Server
  • SQL Server Engine: SQL Server 2008 SQL Server accept remote connections? Yes.
  • ASP.NET version: 2.0.50727
  • The connections via TCP/IP are enabled to the SQL Server instance? Yes.
  • The corresponding user that I have in the connection string, actually exists into the database with the “owner” role? Yes.
  • ORM Tool used: nHibernate

I get the following error when I try to run the aplication into the browser:

Error while establishing a connection to the server. When connecting to SQL Server 2005, this failure may occur because the default settings SQL Server does not allow remote connections. (provider: Shared Memory Provider, error: 40 - Co开发者_StackOverflow社区uld not open a connection to SQL Server)

In order to isolate the problem, I made some test. For example, using the web app that works fine I can connect without any problema with the database that uses the web app that can’t. With this evidence I concluded that the problem is within the web app and not into the SQL Server instance. I also google it my problem but sadly I can't find nothing usefull to solve it.

If someone can help me I’ll appreciate that. Thank you so much for your time!


The most likely explanation is that your connection strings are not the same between the two applications. The error in question is talking about the Shared Memory provider, which is not the same as TCP/IP connections.


I've found the problem. In order to solve it, I was install in a virtual machine the same OS (Windows 2003 Server) and IIS (6.0). In this clean enviroment, I've found that the changes that I made in the home page was the problem. This aspx page has Web Parts that I'll investigate to know why is causing troubles with the database connection. I navigate to another page of the web application and it can connect with the database and retrieve information without any problem..but when I try to reach the home page the aplication colapse because of the problem that I tell you in this thread.

I'll post more news about this problem when I resolve it completely

Thanks for your assistance and time.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜