The text of this article is not in this database — only its details are. Read it on the old site: WebAPI: Restful CRUD Operations in WebAPI Using ADO.NET Objects and SQL Server
27 Comments
Join the conversation! Your thoughts help the community grow.
Sign in to leave a comment.

Sohil SanghaviPosted Sep 14, 2020, 1:53 AM
How to test the put delete and post without using fiddler
abdulrehman anwarPosted Jul 9, 2019, 8:26 AM
You are missing this [ActionName("AddEmployee")] please wite this code below httppost, as you declare for others get , and delete
Viral OndhiyaPosted Jun 20, 2019, 12:05 AM
Hi, nice explanation by this articles. but i have error in POST method. Null Reference Exception. occur in WebAPIViral.dll but not was handled use code .
monir hossainPosted Jan 6, 2019, 2:12 AM
Good article. Thanks a lot.
devi prasadPosted May 13, 2018, 4:18 AM
Getting error message port 57888 is in use
donlot ganolPosted Nov 14, 2017, 3:18 AM
Hai, i wanna ask to part get method, how can i show all data? because i tried ur code, i got 1 data only. thank u so much.
Marcos GalavizPosted Sep 13, 2017, 10:11 AM
Hi I realy apreciate your code, Im new with "C", I use your example to get data from my own database and is great, but if a want to make for example a GetAllEmployees, do I have to doit in the same controller? Im confused I realy apreciate any help to understand it better :(
Shams RehmanPosted Jan 31, 2017, 5:49 AM
I know these methods and i have test also.Now i need complete project which is design.
pranav gautamPosted Jan 27, 2017, 4:17 AM
In my case its returng the type like its returning webApiDemo.Models.Employee
ali radPosted Jan 19, 2017, 2:28 AM
G'day mate. for HTTPPost request you must determine Content-Type : application/json in Fiddler. it works correctly
Pankaj GuptaPosted Dec 5, 2016, 2:09 PM
Delete is working but insert means " public void AddEmployee(Employee employee)" employee is taking null values...Plz guide.
shashi kantPosted Jul 14, 2016, 6:50 AM
Please tell me how to consume this to add record as I am getting object reference exception error.
Arvind ChourasiyaPosted Apr 30, 2016, 7:05 AM
and connection string is- string cs = "data source=GSPSDELL102\\SQLEXPRESS;database=LoadTest2010;max pool size=500;Pooling=False;Integrated Security=SSPI";
Arvind ChourasiyaPosted Apr 30, 2016, 7:05 AM
Getting error 404 while debugging with fidler my url is http://localhost:29455/api/Emp/GetEmployeeById/20 my project Name-WebApiDemo Controller Name-EmpContrller and Model Name-Employee.
ranveer markadPosted Mar 1, 2016, 3:03 PM
not work post method AddEmployee and Delete
Ryan NzPosted Feb 29, 2016, 7:01 AM
Sorry to come back and ask again. Now I am testing the Post action. But I keep getting the object reference not set an instance of an object. This was tested with the sample demo provided but it didn't work either. Thanks for your help.
Ryan NzPosted Feb 29, 2016, 5:34 AM
Now I found the reason. In the WebApiConfig.cs, the routeTemplate needs to be routeTemplate: "api/{controller}/{action}/{id}", For some reason the action is missing.
Sachin KaliaPosted Feb 28, 2016, 11:50 AM
were you able to manage get request perfectly?
Sachin KaliaPosted Feb 28, 2016, 11:49 AM
You may be confronting this error because you didn't choose POST option from dropdown just left to http://localhost:57888/api/Employees/AddEmployee .Please share me exact steps what are you performing..
Ryan NzPosted Feb 28, 2016, 6:21 AM
same problem here. Are you able to fix this?
uzair qurashiPosted Nov 12, 2015, 3:09 PM
Hi.. hope u r fine... i have a problem when i test to post method in wep api using fiddler ..HTTP/1.1 404 Not Found is shown