I created a rest service which contains two methods one method to get the records from data base using Get verb.I'm successful in getting that.But while another method is post which is used to insert a record in to the table. But it is giving error response text as:
Here is the response given to my html file:
<body>
<div id="content">
<p class="heading1">Request Error</p>
<p>The server encountered an error processing the request. The exception message is 'An error occurred while updating the entries. See the inner exception for details.'. See server logs for more details. The exception stack trace is: </p>
<p> at System.Data.Entity.Internal.InternalContext.SaveChanges()
at EmployeeService.EmployeeInfoService.InsertEmployee()
at SyncInvokeInsertEmployee(Object , Object[] , Object[] )
at System.ServiceModel.Dispatcher.SyncMethodInvoker.Invoke(Object instance, Object[] inputs, Object[]& outputs)
at System.ServiceModel.Dispatcher.DispatchOperationRuntime.InvokeBegin(MessageRpc& rpc)
at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage5(MessageRpc& rpc)
at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage31(MessageRpc& rpc)
at System.ServiceModel.Dispatcher.MessageRpc.Process(Boolean isOperationContextSet)</p>
</div>
</body>
</html>
But I'm able to insert the record by not hosting in IIS.
Before i was unable to get the records also.I that time i searched the internet.They said you should add network service login to sql server and add suitable priveleges to the data base. After that i'm able to get the records and display in browser.But the insertion is not happening.Please suggest me the solution?