Reputation: 1700
I'm developing a windows form application. Could any one please advise what are the different ways I can connect to database and retrieve the data.
I know one way is through Webservice? Is there any other way? I am guessing no?
Any help much appreciated.
Upvotes: 0
Views: 693
Reputation: 2275
There are several ways. cuz you ask General question.
but Almost, we can group ways into 2 group:
For first group we have 2 famous way in .net: ADO and Linq
For second, You can think about Wcf, Web Services.(otherwise in order use this way, you need to local way's in your service to access to database).
This is related to your program-architecture.
Upvotes: 1
Reputation: 27937
Best thing to start is to get an overview on http://msdn.microsoft.com/en-us/data/default
Upvotes: 0
Reputation: 33657
Your question is too general but let me try to answer it. In case the Data base server is across WAN you will need to expose some web service on server to expose the data from data base otherwise in case the database is in a LAN environment or on local machine you can use various data access components on .NET like ADO.NET, Linq to SQL, EF etc to access the database.
Upvotes: 3
Reputation: 11146
If Database is on different server than local application you can use either Webservices to get data or open port and allow TCP/IP connections in SqlServer to access from anywhere ( or specific location by blocking IP addresses in firewall ). Second one is not secure.
Upvotes: 1
Reputation: 4179
You can connect to the database in different designs. Like, different access layers, using Data access layer. You can use web service but not required much in this case.
You can approach MVC model too.
At the final alternate, simply use inside the form itself.
Upvotes: 0