SQL无法通过IP地址C#连接
我想知道是否有人可以帮助我解决这个问题?即使我正确地为SQL Server的端口号和IP地址提供了我的IDE,我也无法连接到SQL Server。
static SqlConnection connection = new SqlConnection(@"Data Source=192.168.1.198,49172;Initial Catalog=irradix_base;Integrated Security=False;User ID=sa;Password=pass;");
I was wondering if someone could help me with this problem I have? I am not able to connect to my SQL server even though I correctly provided my IDE with the SQL server's port number and my IP address.
static SqlConnection connection = new SqlConnection(@"Data Source=192.168.1.198,49172;Initial Catalog=irradix_base;Integrated Security=False;User ID=sa;Password=pass;");
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
你能这样尝试吗
数据源= 192.168.1.198,49172;初始目录= EnverifyDB;用户ID = SA;密码= 123456
Can you try this way
Data Source=192.168.1.198,49172;Initial Catalog=EnVerifyDB;User ID=sa;Password=123456
因此,事实证明,我从使用PowerShell命令查找听力端口,这是代码:
So as it turns out, I found an answer from this post which uses a powershell command to find the listening port, here is the code: