Hi there.
I am developing a client-server application using C# and SQL Server 2005.
Right now, I am using web services to access database, but I'm wondering if
this is the best way. The purpose of using web services is to reuse them
with a web application, for instance. However, I think I could use stored
procedures, and when I need to build a web application, I could then build a
web service to call this stored procedures.
What are the advantages/disadvantages of each one?
Thanks in advance.
Regards,
Marco
sloan - 30 Apr 2008 16:06 GMT
"Best" is subjective.
You might look at WCF, which gives you better future flexibility.
Check
http://sholliday.spaces.live.com/Blog/cns!A68482B9628A842A!158.entry
or maybe look at Astoria
http://www.microsoft.com/downloads/details.aspx?FamilyId=1B6F85BC-8933-4D0E-A639
-934EF85ADCE1&displaylang=en
I have a web application that calls/uses/consumes WCF services.
> Hi there.
>
[quoted text clipped - 13 lines]
>
> Marco
parez - 30 Apr 2008 18:41 GMT
> Hi there.
>
[quoted text clipped - 13 lines]
>
> Marco
This is what i think..
It will depend on many factors. like where will your c# app going to
run? is this an intranet application or should it also work from your
home (without vpn)
I am assuming that you are going to use Stored procedures with Data
access layer. with the web service/WCF.
If it is intranet app,
you will get better performance if you use your app + Stored
procedures with Data access layer
If your web application will be Asp.net application then you can re-
use the "Stored procedures with Data access layer"
but if you have some other technology you will better off with the web
services + Stored procedures with Data access layer approach.
if your app is going run over internet, then web services/wcf approach
would be better
Arne Vajhøj - 01 May 2008 00:55 GMT
> I am developing a client-server application using C# and SQL Server 2005.
>
> Right now, I am using web services to access database, but I'm wondering if
> this is the best way.
You should only expose your DAL as web service in very special
circumstances.
You should expose your BLL as web service if you foresee a need to
use it from apps written in different technologies/languages.
> The purpose of using web services is to reuse them
> with a web application, for instance.
No. See above.
> However, I think I could use stored
> procedures,
You could.
But the decision whether to use SP's or plain SQL in your DAL is not
related to the interfaces provided by DAL and BLL.
> and when I need to build a web application, I could then build a
> web service to call this stored procedures.
See above.
> What are the advantages/disadvantages of each one?
Web services and stored procedures can not replace each other so
advantages/disadvantages between them does not have any meaning.
Arne