通过代理连接将Windows应用程序与SQL Server连接 [英] Connecting the Windows application with SQL Server via proxy connection

查看:70
本文介绍了通过代理连接将Windows应用程序与SQL Server连接的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我是.Net C#2010 RC和SQL Server 2005的软件开发人员.

当前正在开发Windows应用程序软件,其中数据库位于Web服务器中.

当办公室通过LAN连接时,必须在商店和办公室中实现软件.代理服务器和商店通过直接连接进行连接.

我自己通过SQLClient连接到服务器,我在连接字符串中使用服务器的IP地址.

在商店(直接连接)中实现时,效果很好.

但是,当尝试将软件连接到Office中的数据库(通过Proxy)时,它会生成错误
建立与SQL Server的连接时发生了与网络相关或特定于实例的错误.找不到服务器或无法访问该服务器.请验证实例名称正确并且将SQL Server配置为允许远程连接.(提供者:命名管道提供程序,错误:40-无法打开与SQL Server的连接)"

请帮助我解决此问题.

而且,这是我的第一个Windows应用程序,我基本上是Web开发人员,我是网络相关系统编程的新手.
我曾推荐过多个网站,其中有些程序存在错误或无法实现.

问候

Kuthubus Saman




感谢您的答复.

但是SQL Server允许远程连接,即,通过Direct DSL或拨号连接从安装位置连接到远程服务器时,它可以很好地执行.

尝试仅通过代理连接从SQL Server检索数据时发生问题或错误.

Hi,

I am a software developer in .Net C# 2010 RC & SQL Server 2005.

Currently developing a Windows Application Software in which the database is located in Web Server.

Software has to be implemented in stores and office, where as office is connected via LAN -> proxy server and stores are connected via Direct connection.

Myself connecting to the server via SQLClient in which I use IP Address of the server in the connection string.

When implemented in stores(direct connection) it works fine.

But when tried to connect the software to database in office(via Proxy), it generates error
"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: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server)"

Please help me to sort out this issue.

Moreover this is my first windows application, I am basically Web developer, I am novice in network related system programming.

I had referred multiple websites, there are some programs, which have bugs or unable to implement.

Regards

Kuthubus Saman


Hi,

thanks for your reply.

But SQL Server is allowing remote connections viz., when connecting from a installation location to remote server via Direct DSL or dial up connection, it executes finely.

Problem or Error occurs when trying to retrieve data from SQL Server through Proxy connection only.

推荐答案

错误看起来像是表面区域配置问题.
当前在数据库服务器上禁用了远程连接.启用它.

1.打开此窗口:开始"->所有程序"->"MS SQL Server 2005"->配置工具-> SQL Server外围应用配置器
2.选择服务和连接"的外围应用配置"
3.选择"MSSQLServer"->数据库引擎"->远程连接"
4.现在选择单选按钮:本地和远程连接
5.同时选择同时使用TCP/IP和命名管道
6.选择确定按钮.您可以根据需要重新启动SQL服务.
Error looks like a Surface Area Configuration issue.
Remote connections are currently disabled on the database server. Enable it.

1. Open this: Start->All Programs->MS SQL Server 2005-> Configuration Tools -> SQL Server Surface Area Configuration
2. Choose Surface Area configuration for Services and Connections
3. Select MSSQLServer->Database Engines->Remote Connections
4. Now select radio button: Local and Remote Connections
5. Also select using both TCP/IP and named pipes
6. Select Ok button. You can restart the SQL Service if needed.


您好Kuthubus Saman,我不知道如何通过电子邮件或其他方式与您联系,所以我回答只是与您交谈,我也在提出申请它需要将信息存储到服务器,投票系统而不是ASP或其他任何东西,桌面应用程序中,请您能帮助我建立这种连接,例如使用Internet并将投票从一台计算机存储到另一台计算机上,我将非常感谢,您甚至无法开始想象.预先谢谢您,请回复
hello Kuthubus Saman, i didnt know how to contact you via email or anything so i replied just to talk to you, i am also making an application which needs to store information onto a server, its a voting system but not in ASP or anything, its a desktop application, can you please help me make this connection, like using internet and storing the votes from one computer onto another computer, i will be sooooooo grateful you cannot even begin to imagine. Thank You in advance please do reply


这篇关于通过代理连接将Windows应用程序与SQL Server连接的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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