开发者

I can't display my pages on ASP.NET

开发者 https://www.devze.com 2023-01-03 12:47 出处:网络
I\'m developing a web site with asp.net on localhost, I\'m beginner. I wrote a login page and it works well. However when I click a link, the server can\'t load the page and gives this error:

I'm developing a web site with asp.net on localhost, I'm beginner. I wrote a login page and it works well. However when I click a link, the server can't load the page and gives this error:

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 c开发者_如何学Goonnection to SQL Server)

Any idea?


This means you either:

  • provided the wrong login/password for SQL while using SQL authentication
  • have used Windows authentication for SQL but the user that your web app is running as doesn't have a login
  • have provided the wrong connection details for the sql instance so it can't be found
  • don't have remote connections enabled for that SQL server instance


Are you using SQL server? If yes, run a debug and see what is the connection string at run time and whether you can connect to the DB using the connection string.

In case you are not using SQL server, it seems, you have extended the membership provider but not done so for the role provider. The default role provider tries to connect to SQL Server instance.

0

精彩评论

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

关注公众号