无法连接 UWP 应用.到 SQL Server 2017 实例: [英] Cannot connect UWP app. to SQL Server 2017 instance:

查看:58
本文介绍了无法连接 UWP 应用.到 SQL Server 2017 实例:的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

UWP 应用.返回

<块引用>

与 SQL Server 建立连接时发生与网络相关或特定于实例的错误.
服务器未找到或无法访问.
验证实例名称是否正确以及 SQL Server 是否配置为允许远程连接.
(提供者:TCP 提供者,错误:25 - 连接字符串无效)"

尝试连接到 SQL Server 2017 实例.

这一切都在本地开发者身上.机器,Windows 10(无遥控器).

遵循 SO 中的建议无济于事:

请检查首先,设置您的解决方案部分,如果您设置了正确的目标/最低版本、功能等.

我的连接字符串与您不同.例如,'Data Source=172.xx.xx.xx;Initial Catalog=MyDataBase;;User ID=sa;Password=Password'

我没有停止 Windows 防火墙,但我在入站规则"中添加了新规则.我在规则中添加了 TCP 端口 1433 并允许连接.

UWP app. returns

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: TCP Provider, error: 25 - Connection string is not valid)"

Trying to connect to a SQL Server 2017 instance.

This is all on a local dev. machine, Windows 10 (no remote).

Have followed advice in SO to no avail: Connection string is not valid or Error Locating Server/Instance

  • SQL server service is running.
  • Can connect in SSMS.
  • "SQL Server Browser" Service is running, TCP/IP Enabled.
  • I stopped Kaspersky & then Windows firewall altogether. No joy.

Connection string that fails:

@"Data Source=JUPITER\MSSQLSERVER01;Initial Catalog=GumbysNorthwind;User ID=sa;Password=xxxxxx_xxxx";

Same UWP App does manage to connect to SQL server 2014 instance.

Any suggestions please?

解决方案

I followed the Use a SQL Server database in a UWP app document to do tests. I can connect to the sqlserver database successfully.

Please check the First, setup your solution section, if you have set the correct target/min version, capability etc.

My connection string is different from you. E.g, 'Data Source=172.xx.xx.xx;Initial Catalog=MyDataBase;;User ID=sa;Password=Password'

I have not stopped the Windows firewall, but I add a new rule in 'Inbound Rules'. I add the TCP port 1433 in the rule and allow the connection.

这篇关于无法连接 UWP 应用.到 SQL Server 2017 实例:的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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