The best way to access data over the Internet. ADO.Net dataservices?

This may sound like a newbie, but forgive me. I am new to dot Net world.

I need to create a desktop application that connects to my local SQL Server database. However, in some cases, the same database will run on a server that can be accessed over the Internet.

What is the best way to design such a program. Basically a program is a collection of data entry forms, I thought of having each request as a web service to get data from the server and then sending it back as a web service. But is there a better way to solve such a problem? I want to use the same program in both cases, just make changes to the config file to tell the program to use a local database or a database on a remote server. Since I'm a beginner, I don't know how to architect a program. Have I heard a little about ADO.Net services? is what is the best way to get around this problem and where does LLB Gen pro fit in ??

thanks for the help

+1


source to share


3 answers


I personally would build this kind of logic in your DAL (Data Access Layer). Whether using ADO.Net or otherwise, the concept remains the same as you create a flexible way to connect to both remote databases and local databases based on what is a requirement for your application.

After that, the devil is in the details. You will, of course, want to take a look at links like this one for accidentally connected apps from Microsoft.



Also check this link for creating DAL with ADO.Net.

Good luck!

+2


source


.NET Remoting or WCF would be more optimal. WCF will allow you to use different channels, be it a web service or a binary data format. Any of the methods is customizable. The Remoting option will allow you to have the same API running locally or in a service, although the details can be tricky. In general, web services are better suited for applications that run over the Internet because the HTTP protocol can be configured or allowed to be accessed through proxy servers and firewalls.



+1


source


You can just use the usual way to use an ADO.NET connection to the database server with a connection string through the SqlConnection object. Just make sure your "internet connection" allows such a connection (it might happen if you don't have a nasty firewall).

0


source







All Articles