本文介绍了错误连接到SQL Server 2008 R2防爆preSS的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经在Windows 7上安装了SQL Server 2008 R2防爆preSS。

I have installed SQL Server 2008 R2 Express on Windows 7.

当我运行在VS2010我收到以下错误Web项目:

When I run a web project in VS2010 I receive the following error:

时出现与网络相关的或特定于实例的错误,而  建立SQL Server的连接。服务器未找到或  无法访问。验证实例名称是否正确,以及  SQL Server配置为允许远程连接。 (提供者:SQL  网络接口,error:26 - 错误定位服务器/实例  指定)

奇怪,我的工作在本地机器上(VS2010,IIS,SQL Server等无需网络)。

Strange, I am working on the local machine (VS2010, IIS, SQL Server, etc. no network needed).

我GOOGLE了四周,随后许多技巧。没有什么帮助。

I googled around and followed many tips. Nothing helps.

我用正确的实例名称(例如:像数据源= PCName \ SQLServer的;初始目录= SampleDBName;集成安全性=真

I use the correct instance name (e.g. like Data Source=PCName\SQLServer;Initial Catalog=SampleDBName;Integrated Security=True)

给了网络服务的权利凭证,等等,等等等等。

Gave the Network Service the right credentials, etc. etc. etc.

我现在输了,现在有这个问题了一个星期。拉我的头发!

I am lost now and having this problem for a week now. Pulling my hair out!

更新:

我有一个尖来测试我使用SQL Server Management Studio中前preSS的连接字符串。在连接弹出屏幕,您通常使用的登录选项卡(第一和默认选项卡)。您还可以使用第三个选项卡其他连接参数。我测试了我的连接字符串,它只是正常工作!

I got a tip to test my connection string with SQL Server Management Studio Express. In the Connect popup screen you usually use the Login tab (first and default tab). You can also use the third tab 'Additional Connection Parameters'. I tested my connect string and it just works fine!

所以,我认为这是东西的权利。但我不知道或...

So, I think it's something with rights. But I have no idea what or which ...

0是的。一些额外的信息。我从ApplicationPoolIdentity到网络服务改变了应用程序池默认选项为IIS 7.5。我加入了网络服务的登录到SQL,给了补助金的权利,等等。我转身SQL浏览器服务上,该服务正在运行(但是因为我跑当地是不是真的有必要)。

O yeah. Some extra info.I changed Application pools default options for IIS 7.5 from 'ApplicationPoolIdentity' to 'NetworkService'. I added the Network Service as login to SQL, gave grant rights, etc.I turned SQL Browser service on, the service is running (but it is not really necessary because I run local).

更新2:

它看起来像我发现是什么原因造成的错误,但我不知道为什么。

It's seems like I found what causes the error, but I have no clue why.

有关我的网站,我创建了一些虚拟文件夹和应用程序的网站。我需要在我的逻辑中的URL。为此我使用一个主机头(如 HTTP://server.name.tld

For my website I created a website with some virtual folders and applications. I need an url in my logic. Therefor I use a host header (like http://server.name.tld)

在VS2010我配置属性页 - >启动选项 - >使用自定义的Web服务器的URL(与前面提到的主机头)

In VS2010 I configured Property pages -> start options -> use custom web server with the url (same as the earlier mentioned host header).

如果我这样做,我得到的错误。

If I do that I get the error.

如果我用用属性页 - >启动选项 - >默认Web服务器,看来我到达数据库的连接

If I use use Property pages -> start options -> default web server, it seems that I get a connection to the db.

但我需要使用的主机头。

But I need the use of the host header.

我需要做什么做的,得到了​​自定义Web服务器的工作?

What do I need to do, to get the 'custom web server' working?

更新3:

今天也试过用测试虚拟机与Windows Server 2008仍然得到错误。

Tried today also with a test virtual machine with windows server 2008. Still getting the error.

也做了测试Web应用程序,无需IIS站点的无主机头。那一个工作得很好(使用相同的CONNECTSTRING)。同样在虚拟机。

Also made a test web application, without an IIS site an without a host-header. That one works just fine (using the same connectstring). Also on the VM.

我很失落。我真的需要有人谁可以在这一领域的交流有一定的了解,我...

I am lost. I really need someone who can exchange some knowledge to me in this field ...

推荐答案

发现问题。配置与会话分贝的web.config,但没有会话分贝创建,并没有规划任何更长的时间才能这样做。忘了把它关掉......

red cheeks

Found the problem. Web.config configured with a session db, but no session db created and wasn't planning any longer to do so. Forget to turn it off ...

这篇关于错误连接到SQL Server 2008 R2防爆preSS的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-05 09:40