views:

223

answers:

2

Hi

I have a problem during insert to database by LINQ command in WCF Service from Silverlight application. Receiving data works fine - select works in LINQ and shows data from database(sql server 2008). When i try to insert data, the Error ocures:

System.Net.WebException: The remote server returned an error: NotFound. ---> System.Net.WebException: The remote server returned an error: NotFound.
   at System.Net.Browser.BrowserHttpWebRequest.InternalEndGetResponse(IAsyncResult asyncResult)
   at System.Net.Browser.BrowserHttpWebRequest.<>c__DisplayClass5.<EndGetResponse>b__4(Object sendState)
   at System.Net.Browser.AsyncHelper.<>c__DisplayClass2.<BeginOnUI>b__0(Object sendState)
   --- End of inner exception stack trace ---
   at System.Net.Browser.AsyncHelper.BeginOnUI(SendOrPostCallback beginMethod, Object state)
   at System.Net.Browser.BrowserHttpWebRequest.EndGetResponse(IAsyncResult asyncResult)
   at System.ServiceModel.Channels.HttpChannelFactory.HttpRequestChannel.HttpChannelAsyncRequest.CompleteGetResponse(IAsyncResult result)}

It looks the same, when i had a wrong ClientConfig/Web.config file. Please Help...I need to insert some data:)

A: 

This is the default error Silverlight will get unless you specify a FaultContract on your WCF service and configure it (via a custom behavior) to send a 200 status code, instead of 500.

Take a look at this article on Fault Strategies for Silverlight for more info: http://msdn.microsoft.com/en-us/magazine/ee294456.aspx

Jason Cono
A: 

OK thanks to Fiddler i can see the problem:

w GalleryService.position_order.set_asortment_id(Nullable`1 value) w C:\Monoceros\SilverGallery\GalleryService\MainDataSource.designer.cs:row 816

It seam like LINQ has a problem with inserting GUIDs do related tables. It inserted GUID to table order. The problem is with order positions:( HELP!!!

Rafal