[英]Connect ASP.Net application from web to my sql database on my computer
I am creating two applications: An ASP.Net application and a C# application. 我正在创建两个应用程序:一个ASP.Net应用程序和一个C#应用程序。 I used SQL Server as the database.
我使用SQL Server作为数据库。 My ASP.Net application should connect to the internet but the database should only be on my computer.
我的ASP.Net应用程序应该连接到Internet,但是数据库只能位于我的计算机上。 I used connectionString to connect my two applications in just one database (SQL).
我使用connectionString在一个数据库(SQL)中连接两个应用程序。 Is there a way to connect my ASP.Net application from the web to my SQL database on my computer?
有没有一种方法可以将我的ASP.Net应用程序从Web连接到计算机上的SQL数据库?
I've read lots of tutorial but I can't find the solution. 我已经阅读了很多教程,但是找不到解决方案。
Ordinary SQL Server is local to to the Web application (it's either located on the same LAN or sometimes even on the same machine). 普通SQL Server对Web应用程序而言是本地的(它位于同一LAN上,有时甚至位于同一台计算机上)。
Technically it is possible to connect an ASP.NET application to a remote SQL server, but it is not recommended, you can open a can of worms there (problems with firewalls, ports, performance etc.) 从技术上讲,可以将ASP.NET应用程序连接到远程SQL Server,但是不建议这样做,您可以在其中打开蠕虫病毒(防火墙,端口,性能等问题)。
Here's my solution for that: 这是我的解决方案:
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.