Skip to main content

Microsoft Silverlight

Answered Question Problem with the latest tutorial (WCF WebService + LINQ + SQL)RSS Feed

(0)

Maciek
Maciek

Member

Member

123 points

108 Posts

Problem with the latest tutorial (WCF WebService + LINQ + SQL)

 Hi all,

I believe I've managed to follow everything that has been said in the tutorial. When I've run the application, I've a single character in teh textbox and pressed the "Search" button. After that the browser's window went white. I've restarted the whole thing in debug mode and it turned out that the problem came from here :
 

void Search_Click(object sender, RoutedEventArgs e)
{
   ServiceReference1.Service1Client webService =
    new SQLData.ServiceReference1.Service1Client();
  webService.GetCustomersByLastNameCompleted +=
    new EventHandler<SQLData.ServiceReference1.
    GetCustomersByLastNameCompletedEventArgs>
    (webService_GetCustomersByLastNameCompleted);
    webService.GetCustomersByLastNameAsync(LastName.Text);
}
 
The bolded line of code returns a null  for some reason and thus is unable to run further. Can anyone suggest a solution to this ?
PS. As Jesse wrote in the tutorial, I've enabled the serialisation on the *.dbml's datacontext and I've modified the entry in web.config to use "basicHttpBinding" . Have I missed something ?
 
Sincirely 

Maciek
Maciek

Member

Member

123 points

108 Posts

Answered Question

Re: Problem with the latest tutorial (WCF WebService + LINQ + SQL)

 Weird, I've compiled the whole thing again and it worked. Can anyone tell me what could be the reason to the ServiceClient() constructor returning a null in the first place ?

  • Unanswered Question
  • Answered Question
  • Announcement
Microsoft Communities