Internet主机中的ASP.NEt,但本地服务器中的SQL Server [英] ASP.NEt in Internet Host but SQL Server in Local Server

查看:72
本文介绍了Internet主机中的ASP.NEt,但本地服务器中的SQL Server的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨专家

我想在Internet主机上发布一个c#asp.net应用程序,但是该数据库(sql server 2008)位于本地服务器中,因为其他本地应用程序已连接到该服务器.
该应用程序可以在我的计算机上正常运行.
我认为我需要有效的IP地址才能从网站连接到sql服务器,但我不确定,也没有在google中找到任何说明.
您对此解决方案或某些良好的说明链接有什么解决方案吗?
感谢您的帮助

hi experts

i want to release a c# asp.net application on internet host, but the database (sql server 2008) is in a local server because other local applications are connected to it.
the application works fine in my computer.
i think i need a valid IP for connecting to sql server from the website but i''m not sure and didn''t find any instructions in google.
do you have any solution for this or some good instructions links?
thanks for helping

推荐答案

您需要为其数据库服务器提供静态IP.一旦有了它,然后在连接字符串中使用如下所示的数据源:
"data source = IPAddress\InstanceName,portnumber"

看看这些文章:
MSDN:通过Internet连接到SQL Server [ Microsoft Technet:配置DHCP服务器静态IP地址 [
You need to have static IP for your database server for it. Once you have that, then use something like this in connection string for datasource:
"data source = IPAddress\InstanceName,portnumber"

Look at these article:
MSDN: Connecting to SQL Server over the Internet[^]
Microsoft Technet: Configuring a DHCP server static IP address[^]


BTW, You should create a service or some sort of intermediary way to expose your database for connections, exposing the whole thing to the internet will be risky from data security propespective!



这篇关于Internet主机中的ASP.NEt,但本地服务器中的SQL Server的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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