I was wondering which thing is better from below two…
- retrieve data by creating webservice
- create database connection from code behind call stored procedure and retrieve data
Can anyone one explain how it differs?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Well, if you have no reason to use a web service then don’t. It’s always better to remove unnecessary layers when you can and go directly against the DB (via separate class library of course) if you can. There’s really no reason to use a web service just for the sake of using it.
A web service is useful if you are going to be spreading code across servers for better scalability. But if everything is going to be running on the same server, there’s not really much advantage in the extra complexity involved with a web service. If you want to layer your code, you could just as easily create a class library for the DB code.