0
votes

I recently deployed a .Net 4 WCF Data Service hosted on IIS 6, within a corporate environment (intranet), using Entity Framework. I access the service using OData and have been successful retrieving data from tables hosted on SQL Server 2005.

The issue is that I am unable to insert new rows. What I've done so far is to set entity rights to ALL -> ie.

config.SetEntitySetAccessRule("*", EntitySetRights.All);

I'm using integrated security on IIS. When I do a POST using jQuery, it returns 500 error code. I'm able to insert rows to a local database in my development environment.

Thanks

1
Please try to enable detailed error messages on the server (blogs.msdn.com/b/phaniraj/archive/2008/06/18/…) and then update the question with the error message you get from the server.Vitek Karas MSFT
Agreed - if you can provide additional information about the error that you're seeing, then we can provide some help. Right now, I don't think you've provided enough information about the error.David Hoerster

1 Answers

0
votes

I figured it out. I was receiving error

"Unable to update the EntitySet because it has a DefiningQuery and no >element exists in the element to support the current >operation."

This was caused because the table, although having an identity field, didn't specify it as a Primary Key. Set the Primary key and all is well.

Fixing the System.Data.UpdateException – DefiningQuery and no Error helped.

Thanks