This is a migrated thread and some comments may be shown as answers.

Trouble Databinding RIA Service

1 Answer 89 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Justin
Top achievements
Rank 1
Justin asked on 03 Sep 2011, 12:32 AM
I worked through the Databinding > RIA tutorial on page 91 of the RadControls Silverlight courseware pdf line by line. When I run it IE crashes and I get the error below. Any Ideas?:

{System.ServiceModel.DomainServices.Client.DomainOperationException: Load operation failed for query 'GetWorkforceSeparationCurrent1'. 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.<>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)
   --- 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)
   --- End of inner exception stack trace ---}

Here's my VB code:

Imports RadControlsSilverlightApp1.Web
Imports System.ServiceModel.DomainServices.Client
 
Partial Public Class MainPage
    Inherits UserControl
 
 
    Public Sub New()
        InitializeComponent()
        Dim context As New WorkForceDomainContext
        Dim operation As LoadOperation = context.Load(context.GetWorkforceSeparationCurrent1Query())
        AddHandler operation.Completed, AddressOf operation_Completed
    End Sub
 
    Private Sub operation_Completed(ByVal sender As Object, ByVal e As EventArgs)
        Try
 
        Dim context As New WorkForceDomainContext
 
        Dim loadOperation As ServiceModel.DomainServices.Client.LoadOperation = TryCast(sender, ServiceModel.DomainServices.Client.LoadOperation)
        If loadOperation.Error Is Nothing Then <<<<< ERROR HERE
            RadGridView1.ItemsSource = _
                From w As WorkforceSeparationCurrent1 In loadOperation.Entities _
                Where w.RetType = "csrs" _
                Select w
            End If
        Catch ex As Exception
 
        End Try
    End Sub
End Class

1 Answer, 1 is accepted

Sort by
0
Rossen Hristov
Telerik team
answered on 07 Sep 2011, 12:42 PM
Hi Justin,

Here is what the exception says: "Load operation failed for query 'GetWorkforceSeparationCurrent1'. The remote server returned an error: NotFound."

This means that the query (i.e. method) with name GetWorkforceSeparationCurrent1 cannot be found on the service class in your server project. 

Does your service class has such a method, because if you were following the tutorial line-by-line your query would be called Employees and not GetWorkforceSeparationCurrent1.

To learn more about WCF RIA Services, please take a look here. There are a lot of video tutorials that will get you started in no time. 

Greetings,
Ross
the Telerik team

Thank you for being the most amazing .NET community! Your unfailing support is what helps us charge forward! We'd appreciate your vote for Telerik in this year's DevProConnections Awards. We are competing in mind-blowing 20 categories and every vote counts! VOTE for Telerik NOW >>

Tags
GridView
Asked by
Justin
Top achievements
Rank 1
Answers by
Rossen Hristov
Telerik team
Share this question
or