title: System.ServiceModel.DomainServices.Client.DomainOperationException: Load operation failed for query
body: <p>I am getting the following error in WCF+Silverlight+RIA Service application. It's happening only on production DB.</p>
  
  <p>I copied the production DB to my development machine, I am getting that error when I point the web.config to my production DB from development environment. If I point to test DB then everything works fine.</p>
  
  <p>So I thought that some mismatch problem in DB so I tried to compare test and production DB and all the DB structures are same.</p></p>
  
  <p>This error occurs only on one function/query 'GetEventViewAll', all other operations are working on that DB. So I thought that the function 'GetEventViewAll' returns more rows, so I deleted all rows on that table, but still getting that error.
  </p>
  
  <p>This error happens only on production DB, not production environment. I am using same machine, same code, same VS2010. I am just making changes only on web.config to point other DB(production) then getting error.</p>
  
  <p>Could anyone please tell me what I missed or what needs to be done?</p>
  
  <p>the error from output window of VS2010 is: <code>
  {System.ServiceModel.DomainServices.Client.DomainOperationException: Load operation failed for query 'GetEventViewAll'. The remote server returned an error: NotFound. ---> System.ServiceModel.CommunicationException: The remote server returned an error: NotFound. ---> 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.&lt;>c__DisplayClassa.b__9(Object sendState)
     at System.Net.Browser.AsyncHelper.&lt;>c__DisplayClass4.b__1(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)
     --- End of inner exception stack trace ---
     at System.ServiceModel.DomainServices.Client.WebDomainClient<code>1.EndQueryCore(IAsyncResult asyncResult)
     at System.ServiceModel.DomainServices.Client.DomainClient.EndQuery(IAsyncResult asyncResult)
     at System.ServiceModel.DomainServices.Client.DomainContext.CompleteLoad(IAsyncResult asyncResult)
     --- End of inner exception stack trace ---}
      [System.ServiceModel.DomainServices.Client.DomainOperationException]: {System.ServiceModel.DomainServices.Client.DomainOperationException: Load operation failed for query 'GetEventViewAll'. The remote server returned an error: NotFound. ---&gt; System.ServiceModel.CommunicationException: The remote server returned an error: NotFound. ---&gt; System.Net.WebException: The remote server returned an error: NotFound. ---&gt; System.Net.WebException: The remote server returned an error: NotFound.
     at System.Net.Browser.BrowserHttpWebRequest.InternalEndGetResponse(IAsyncResult asyncResult)
     at System.Net.Browser.BrowserHttpWebRequest.&lt;&gt;c__DisplayClassa.&lt;EndGetResponse&gt;b__9(Object sendState)
     at System.Net.Browser.AsyncHelper.&lt;&gt;c__DisplayClass4.&lt;BeginOnUI&gt;b__1(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)
     --- End of inner exception stack trace ---
     at System.ServiceModel.DomainServices.Client.WebDomainClient</code>1.EndQueryCore(IAsyncResult asyncResult)
     at System.ServiceModel.DomainServices.Client.DomainClient.EndQuery(IAsyncResult asyncResult)
     at System.ServiceModel.DomainServices.Client.DomainContext.CompleteLoad(IAsyncResult asyncResult)
     --- End of inner exception stack trace ---}
      Data: {System.Collections.ListDictionaryInternal}
      InnerException: {System.ServiceModel.CommunicationException: The remote server returned an error: NotFound. ---> 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.&lt;>c__DisplayClassa.b__9(Object sendState)
     at System.Net.Browser.AsyncHelper.&lt;>c__DisplayClass4.b__1(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)
     --- End of inner exception stack trace ---
     at System.ServiceModel.DomainServices.Client.WebDomainClient`1.EndQueryCore(IAsyncResult asyncResult)
     at System.ServiceModel.DomainServices.Client.DomainClient.EndQuery(IAsyncResult asyncResult)
     at System.ServiceModel.DomainServices.Client.DomainContext.CompleteLoad(IAsyncResult asyncResult)}
      Message: "Load operation failed for query 'GetEventViewAll'. The remote server returned an error: NotFound."
      StackTrace: null
  </code></p>