I am trying to build a silverlight application that shows some data on a gridview.
I have built persistent classes using Open Access ORM and I am writing a WCF
like below.
ArrayList
IService1.GetPatientStudies()
{
IObjectScope scope = ObjectScopeProvider1.GetNewObjectScope();
var query = (from p in scope.Extent<Patient>()
join s in scope.Extent<Study>()
on p.Pk equals s.PatientFk
select new { PatName = p.PatName, StudyDesc = s.StudyDesc });
ArrayList itemList = new ArrayList();
foreach (var data in query)
itemList.Add(data);
return itemList;
}
It simply takes fields from patients and studies tables.
And in MainPage.xaml.cs I have written
void MainPage_Loaded(object sender, RoutedEventArgs e)
{
ServiceReference1.
Service1Client webService = new DatabaseTest.ServiceReference1.Service1Client();
webService.GetPatientStudiesCompleted += new EventHandler<DatabaseTest.ServiceReference1.GetPatientStudiesCompletedEventArgs>(webService_GetPatientStudiesCompleted);
webService.GetPatientStudiesAsync();
}
void webService_GetPatientStudiesCompleted(object sender, DatabaseTest.ServiceReference1.GetPatientStudiesCompletedEventArgs e)
{
testGridView.ItemsSource = e.Result;
}
But it doesn't work a CommunicationException occurs. In the message it says "The remote server returned an error: NotFound."
I couldn't find the problem. Is there a problem in the way I am building the array list.
Please help.
Thanks,
Burhan