locked
Web Service for inserting and updating data in SqlServer RRS feed

  • Question

  • User1989204087 posted

    Hi

    I am new to webservice. I need some advice what will be the best approach to create a webservice to handle inserting and updating data into Sql Server.

    In client app ( WinRT, Windows phone) , I have multiples rows of data as follows:

     item-Name     Quantity       Unit

     ----------    --------      -------  

    King Crab        100          Kg  

    Alaska Crab      200          Kg  

    Hairy Crab       100          kg

     ...              ...          ...

    1) What Type of webservice to use ( SOAP, WCF, Restful )?

    2) The client app send data thru mobile-network, what if there is a bad connection during sending data to server,how to ensure or check that there is no miss out ( if there is 10 items, make 10 items are inserted in Sql server)

    3) What approach to send the data over, using row by row approach or using a loop like foreach-statement?

    Any webservice sample and references are greatly appreciated.

    Thanks

     

    Tuesday, August 6, 2013 10:12 PM

Answers

  • User220959680 posted

    1) What Type of webservice to use ( SOAP, WCF, Restful )?

    RESTful.

    choose ASP.NET Web API to implement REST service that supports CRUD operations.

    Tutorials, samples, videos:  www.asp.net/web-api

    2) The client app send data thru mobile-network, what if there is a bad connection during sending data to server,how to ensure or check that there is no miss out ( if there is 10 items, make 10 items are inserted in Sql server)

    Adopt Transactions, can be database level or service level to ensure that when the network is down/interrupted failed transaction is rolled out. 

    * Security is another factor to be considered here.

    3) What approach to send the data over, using row by row approach or using a loop like foreach-statement?

    Pagination can enhance performance , requiring first 10 or 20 rows to be rendered first, when the client selects Next another 10 or 20 rows to be retrieved ....

    Conclusion: RESTful can be implemented by utilising WCF or Web API. But ASP.NET Web API is convention based rather than configuration (like WCF).

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Wednesday, August 7, 2013 6:47 AM