简体   繁体   English

Visual Studio 2012 Server资源管理器中的SQL Server 2012连接问题

[英]SQL Server 2012 connection issues in Visual Studio 2012 Server Explorer

I am trying to connect to SQL Server 2012 installed on Windows Server 2012 through Visual Studio 2012 but keep getting an error 25 connection string is not valid message when trying to connect through server explorer. 我正在尝试通过Visual Studio 2012连接到Windows Server 2012上安装的SQL Server 2012,但在尝试通过服务器资源管理器进行连接时,始终收到错误25连接字符串无效消息。

As far as I am aware it is sharing the same IP address as the main server. 据我所知,它与主服务器共享相同的IP地址。 I am not connected to the domain but have checked that remote connections are enabled and port 1433. I can also connect to the main server. 我没有连接到域,但是已经检查了是否启用了远程连接和端口1433。我还可以连接到主服务器。

I am new to SQL Server so any advice is greatly appreciated. 我是SQL Server的新手,因此非常感谢您提供任何建议。 Thanks 谢谢

在此处输入图片说明

You must have the correct connection string. 您必须具有正确的连接字符串。 I show the codes in C# : 我在C#中显示代码:

string con = @"Data Source=.\SQLEXPRESS;AttachDbFilename='c:\users\pc\documents\visual studio 2010\Projects\WindowsFormsApplication1\WindowsFormsApplication1\Database1.mdf';Integrated Security=True;User Instance=True";
        SqlConnection concect = new SqlConnection(con);

The data connection string is located in yourdatabase.mdf file in connection string. 数据连接字符串位于连接字符串的yourdatabase.mdf文件中。 you will see that in visual studio. 您将在Visual Studio中看到它。

Update : 更新:

in server explorer right click on dataconnections then choose add connection. 在服务器资源管理器中,右键单击“数据连接”,然后选择“添加连接”。 then select Microsoft SQL Server in server name use "." 然后在服务器名称中选择Microsoft SQL Server,使用“。” for your server name. 为您的服务器名称。 then you can select your database or you can attach your database file. 那么您可以选择数据库或附加数据库文件。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Visual Studio 2012 Server资源管理器中的SQL Server 2012连接问题 - SQL Server 2012 connection issues in Visual Studio 2012 Server Explorer SQL Server 2012允许远程连接 - sql server 2012 allowing remote connection Parallels-在OSx主机中访问Visual Studio 2012 Express Server - Parallels - Access Visual Studio 2012 Express Server in OSx Host SQL Server 2012远程连接给出Timeout和ASYNC_NETWORK_IO错误 - SQL Server 2012 Remote connection giving Timeout and ASYNC_NETWORK_IO errors 如何从网络计算机上备份SQL Server 2012数据库 - How to take backup of sql server 2012 database from network computer Windows(Server 2012)ifIndex持久性 - Windows (Server 2012) ifIndex persistence 使用Visual Studio 2012平板电脑模拟器模拟无网络 - Simulate no network with Visual studio 2012 tablet emulator 无法访问Windows Server 2012上的某些端口 - unable to access some ports on windows server 2012 Oracle数据库-连接请求超时-客户端Windows加入服务器2012年的域后 - Oracle database - connection request timed out - after client windows joins a domain on server 2012 Windows 2012 Server 将网络配置为 2 个 ISP - Windows 2012 Server configure network to 2 ISP
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM