views:

60

answers:

3

I have a service. This service get data from SQL Server.

  1. What the best way to send information to client?
  2. Should I use ADO.NET or Entity Framework?
+1  A: 

From such a brief description it is impossible to say which one is preferred. My personal favourite for such a scenario is Linq to SQL.

Anders Abel
A: 

If they are both .NET then i say WCF. If server does simple manipulations with data consider Linq to SQL. Or nHibernate.

Andrey
FYI, he specified WCF in the title.
John Saunders
A: 

You can use whichever data technology you want. However, up to Entity Framework 4 in .NET 4 (currently in Release Candidate status), it is recommended not to return an Entity Framework entity or a LINQ to SQL class from a web service. Both technologies unfortunately leak their implementation over the wire - the client-side proxy classes would have client-side classes corresponding to the base classes used by the data framework.

Instead, use a Data Transfer Object, which is an object that has nothing but properties that correspond one-to-one with the properties of the data you want transferred.

John Saunders
this is useful.
Sergii

related questions