locked
Which is best approach to connect SQL SERVER RRS feed

  • Question

  • User86716463 posted

    Dear All,

    We are planning to create a custom services/api for microsoft office 365 . the services needs to be get data from sql server. 

    Please let me know which best approach create service .. which is service best one ? version ?  

    Please help me on this..

    Thanks,

    Ramesh 

    Saturday, October 6, 2018 9:01 PM

All replies

  • User1520731567 posted

    Hi n.m.rameshraja,

    We are planning to create a custom services/api for microsoft office 365 .

    You could use Web api or WCF.

    Which is best approach to connect SQL SERVER

    The answer from this article:

    There is no best way for all cases. Some times you need ease of development, some times you need best performance, some times you need compromise of both.

    Also it depends on complexity of your application - whether you have rich domain model, or you simply display table data on UI.

    1.ADO .NET
    Fastest way, but requires lot of manual coding. You should manually setup database connections, open and close them, create commands, provide parameters to commands and execute commands. Mapping of query results also should be done manually.

    2.Linq
    It's not way to connect to database. Linq is language integrated queries, which have many implementations - Linq to Xml, Linq to DataSet, Linq to Object, Linq to SQL, Linq to Entities etc.

    3.Entity Framework
    Entity Framework uses Linq to Entities and it is built on ADO .NET (internally Linq queries are are translated to ADO .NET code). It is easy to use, because Entity Framework handles connections, generate and execute commands, and map query results to entities for you. But you should pay with performance for that.

    Best Regards.

    Yuki Tao

    Monday, October 8, 2018 8:17 AM