WCF无法连接到我的数据库 [英] WCF cannot connect to my database

查看:358
本文介绍了WCF无法连接到我的数据库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这就是我所看到的 

That is what I am seeing 

我该如何解决这个问题?

how do I fix this ?

推荐答案

您的数据库服务器名称不是localhost。这是针对HTTP请求的。对于VS2015 +,您将使用LocalDB。您可以通过SQL Server对象资源管理器获取它的连接字符串。它通常类似于(LocalDB)\ProjectsV {version}。 
说明在
MSDN
(忽略NET核心内容)。

Your DB server name isn't going to be localhost. That is for HTTP requests. For VS2015+ you'll be using LocalDB. You can get the connection string for it via SQL Server Object Explorer. It is generally something like (LocalDB)\ProjectsV{version}.  Instructions are on MSDN (ignore the NET core stuff).

如果您使用的是旧版本的VS,那么您将使用SQLEXPRESS。 VS附带的默认安装(如果已安装)将只是SQLEXPRESS。如果你手动安装它,它将是你命名的任何东西。有关
MSDN 的说明。这是
文件

If you're using an older version of VS then you'll be using SQLEXPRESS. The default install that comes with VS (if installed) would simply be SQLEXPRESS. If you installed it manually then it'll be whatever you named it. Instructions are on MSDN. Here is for files.

请不要在C#论坛上发布一般的VS问题。 C#论坛仅适用于C#特定问题。一般VS问题可以在Visual Studio General论坛(或更具体的论坛)中发布。

Please do not post general VS questions in the C# forums. The C# forums are for C#-specific questions only. General VS questions can be posted in the Visual Studio General forums (or a more specific forum).


这篇关于WCF无法连接到我的数据库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆