Click here to Skip to main content
15,881,882 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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
Posted
Comments
[no name] 30-Apr-14 7:41am    
What kind of help do you suppose that we can give you? Their server would have to be exposed to the outside world in some manner, hint use a web service, and then you write your connection string to connect to their server.
ShanifHassan 30-Apr-14 8:11am    
Actually the data is stored in local machine. So how can we access that data to web application? The web application will be used by different clients. As a result the local data will also change...
[no name] 30-Apr-14 8:25am    
Well then you simply connect to the server on the local machine. In what way is this a problem?
ShanifHassan 30-Apr-14 8:36am    
but we will host the web application somewhere right?
[no name] 30-Apr-14 8:52am    
Yes you will.... in what way is this a problem?

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.
 
Share this answer
 
v2
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.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900