Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C# SQL iPhone WebService
How to create a JSON restful webservice in ASP.NET C# that connect to MS SQL Database and retrieve stored procedures values from the database?. I have all stored procedures, data access layers and business layer available in my project. But I do not know how to create restful web service and how to call stored procedures values.
 
This webservice will eventually be used to communicate with iPhone SDK. And results of this web service will be shown in iPhone application. This iPhone application will be installed on iphone , and it will interact web service to get database values.
 
Any help would be appreciated.
 
Thanks!
Posted 7-Dec-11 23:13pm
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

Using .Net Framework 3.5 or above you can develop REST based Service. You may refer below links for more information on this.
 
http://msdn.microsoft.com/en-us/library/dd203052.aspx
 
http://msdn.microsoft.com/en-us/netframework/dd547388
 
http://msdn.microsoft.com/en-us/netframework/cc950529
 
For JSON and WCF REST Services.
 
http://dotnetninja.wordpress.com/2008/05/02/rest-service-with-wcf-and-json/
 
http://debugmode.net/2011/05/15/wcf-rest-service-with-josn-data/
 
However to develop REST Service, WCF support is not obligatory, you can develop REST Service even using simple HttpHandler or HttpModule.
 
Developing a REST Web Service using C# - A walkthrough
 
To call your SQL Server Stored Procedure you may use Ado.Net.
 
http://www.csharp-station.com/Tutorials/AdoDotNet/Lesson07.aspx
  Permalink  
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 5

For communicating iphone with restful web service which uses json as data, the best library is restkit:
 
https://github.com/RestKit/RestKit[^]
  Permalink  
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 6

Here's a pretty good walkthrough of creating your first JSON web service from scratch, loading and saving data from SQL Server, and even displaying it using JavaScript or on an iPhone:
 

[Creating a JSON Web Service]
 
I think that pretty much covers everything you were asking for !!!
  Permalink  

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 OriginalGriff 5,170
1 DamithSL 4,357
2 Maciej Los 3,750
3 Kornfeld Eliyahu Peter 3,470
4 Sergey Alexandrovich Kryukov 2,851


Advertise | Privacy | Mobile
Web03 | 2.8.141216.1 | Last Updated 4 Dec 2013
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100