如何从本地数据库获取Web应用程序的数据 [英] How can be get data for a web application from a local database

查看:116
本文介绍了如何从本地数据库获取Web应用程序的数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,







我正在尝试为商店创建一个网络应用程序这样客户就可以通过在线方式下订单。商店有一个本地数据库,其中包含产品清单,库存数量,价格等。我想从我的应用程序访问本地数据库,以便当客户下订单时,他们可以找到产品,价格,库存等。 br />


如何将Web应用程序与驻留在商店系统中的本地数据库连接起来。我打算在asp.net中构建这个应用程序。本地数据库是sql server。



任何人都可以帮我这个吗?



谢谢,



Shanif

Hi Everyone,



I'm trying to create a web application for a shop so that the customers can place orders through online itself. The shop has a local database which contain the products lists, stock qty, price etc. I want to access the local data base from my application so that when the customer places an order,they can find the products, price, stock etc.

How can I connect the web application with local datadase that reside in shop's system. I planning to build this application in asp.net. The local database is sql server.

Can anyone help me on this?

Thanks,

Shanif

推荐答案





对于Shopkeeper的本地机器,您需要一个PUBLIC STATIC IP(联系Shopkeeper的互联网服务提供商)。



请在那里阅读以获得更好的低估。我希望它对你来说很可怕.....



http://en.wikipedia.org/wiki/IP_address#Public_addresses



在网络中,每台计算机都分配了一个IP地址。以相同的方式,街道地址标识家庭的位置,IP地址标识网络中的计算机的位置。此外,计算机可以同时保存私有或公共IP地址。专用IP本质上是识别私有或内部网络上的计算机的IP地址,而公共IP识别公共Internet上的计算机。





(http://help.filemaker.com/app/answers/detail/a_id/7466/~/publishing-databases -on-the-file-with-filemaker-pro-and filemaker-server)



http://www.nch.com.au/kb/networking -ipaddress.html

https://in.answers.yahoo.com/question/index?qid=20120727100458AANt2Ls

https://support.hostgator.com/articles / ip-address-static-vs-dynamic-public-vs-private-shared-vs-reseller



如果对你有帮助,请标记。
Hi,

For Shopkeeper's Local machine you need a "PUBLIC STATIC IP" (Contact to Shopkeeper's internet service provider).

Please read there for better understating. i hope it will hellful for you.....

http://en.wikipedia.org/wiki/IP_address#Public_addresses

Within a network, each computer is allocated an IP address. In the same way a street address identifies the location of a home, an IP address identifies the location of a computer within a network. Additionally, a computer can hold both a private or public IP address simultaneously. Private IP's are essentially IP addresses that identify a computer on a private or internal network while a public IP identifies the computer on the public Internet.


(http://help.filemaker.com/app/answers/detail/a_id/7466/~/publishing-databases-on-the-web-with-filemaker-pro-and-filemaker-server)

http://www.nch.com.au/kb/networking-ipaddress.html
https://in.answers.yahoo.com/question/index?qid=20120727100458AANt2Ls
https://support.hostgator.com/articles/ip-address-static-vs-dynamic-public-vs-private-shared-vs-reseller

if it is helpful for you please mark it.


我认为Web应用程序如何与数据库一起工作存在混淆。



Web应用程序首先驻留在服务器计算机上。即使有人从客户端计算机访问您的Web应用程序,它也使用服务器上托管的相同Web应用程序。因此,您无需为每台客户端计算机编写单独的数据连接代码。此外,您将只有一份应用程序副本和一份数据库副本,将在所有客户端共享。



如果您的数据库和Web应用程序相同然后,您可以在应用程序中使用以下连接字符串。



I think there is a confusion on how web application works with database.

First thing web application resides on the server machine. And even if somebody is accessing your web application from client machine, it uses the same web application hosted on the server. So you don't need to write separate data connectivity code for each client machine. Also you will have only one copy of application and one copy of database which will be shared across all the clients.

Second if your database and web application is on the same server then you can use following connection string in your application.

SqlConnection conn = new SqlDbConnection();
conn.ConnectionString =
"Data Source=ServerName;" +
"Initial Catalog=DataBaseName;" +
"User id=UserName;" +
"Password=Secret;";
conn.Open();





如果您还有其他需要,请回复。希望这会对你有所帮助。



Reply back if you need anything more. Hope this helps you.


这篇关于如何从本地数据库获取Web应用程序的数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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