Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. WPF
  4. Problem with Silverlight application using WCF Service to get the data from database without LINQ

Problem with Silverlight application using WCF Service to get the data from database without LINQ

Scheduled Pinned Locked Moved WPF
csharpwcfhelpdatabasewpf
6 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • R Offline
    R Offline
    ravi vellanky
    wrote on last edited by
    #1

    Hi I'm using a wcf service to get the data from the database and bind it silverlight control. And below is the code sample that i've written. Problem here is WCF service that i've created is on basichttpbinding. Silverlight supports only this binding I think. So I changed the end point in my WCF service from default (wsHTTPbining ) to basic. when i add the service reference to the silverlight application the following is the silverlight clientconfig I'm getting with the error that i got when i build the application. <configuration> <system.serviceModel> <bindings> <basicHttpBinding> <binding name="BasicHttpBinding_ITestWCF" maxBufferSize="2147483647" maxReceivedMessageSize="2147483647"> <security mode="None" /> </binding> </basicHttpBinding> </bindings> <client> <endpoint address="http://localhost:8731/TestWCFLib/basic" binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_ITestWCF" contract="testService.ITestWCF" name="BasicHttpBinding_ITestWCF" /> </client> </system.serviceModel> </configuration> Unhandled Error in Silverlight 2 Application An exception occurred during the operation, making the result invalid. Check InnerException for exception details. at System.ComponentModel.AsyncCompletedEventArgs.RaiseExceptionIfNecessary() at MNetMetricSystem.testService.GetBugCountCompletedEventArgs.get_Result() at MNetMetricSystem.OrganizationBaseLine.obj_GetBugCountCompleted(Object sender, GetBugCountCompletedEventArgs e) at MNetMetricSystem.testService.TestWCFClient.OnGetBugCountCompleted(Object state) public partial class OrganizationBaseLine : UserControl 2 { 3 ServiceReference1.MNetMetricsServiceClient Metrics = new MNetMetricSystem.ServiceReference1.MNetMetricsServiceClient(); 4 public OrganizationBaseLine() 5 { 6 InitializeComponent(); 7 Loaded += new RoutedEventHandler(OrganizationBaseLine_Loaded); 8 } 9 10 void OrganizationBaseLine_Loaded(object sender, RoutedEventArgs e) 11 { 12 13 Metrics.GetAllDepartmentsCompleted += new EventHandler(Metrics_GetAllDepartmentsCompleted); 14 Metrics.GetAllDepartmen

    M E 2 Replies Last reply
    0
    • R ravi vellanky

      Hi I'm using a wcf service to get the data from the database and bind it silverlight control. And below is the code sample that i've written. Problem here is WCF service that i've created is on basichttpbinding. Silverlight supports only this binding I think. So I changed the end point in my WCF service from default (wsHTTPbining ) to basic. when i add the service reference to the silverlight application the following is the silverlight clientconfig I'm getting with the error that i got when i build the application. <configuration> <system.serviceModel> <bindings> <basicHttpBinding> <binding name="BasicHttpBinding_ITestWCF" maxBufferSize="2147483647" maxReceivedMessageSize="2147483647"> <security mode="None" /> </binding> </basicHttpBinding> </bindings> <client> <endpoint address="http://localhost:8731/TestWCFLib/basic" binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_ITestWCF" contract="testService.ITestWCF" name="BasicHttpBinding_ITestWCF" /> </client> </system.serviceModel> </configuration> Unhandled Error in Silverlight 2 Application An exception occurred during the operation, making the result invalid. Check InnerException for exception details. at System.ComponentModel.AsyncCompletedEventArgs.RaiseExceptionIfNecessary() at MNetMetricSystem.testService.GetBugCountCompletedEventArgs.get_Result() at MNetMetricSystem.OrganizationBaseLine.obj_GetBugCountCompleted(Object sender, GetBugCountCompletedEventArgs e) at MNetMetricSystem.testService.TestWCFClient.OnGetBugCountCompleted(Object state) public partial class OrganizationBaseLine : UserControl 2 { 3 ServiceReference1.MNetMetricsServiceClient Metrics = new MNetMetricSystem.ServiceReference1.MNetMetricsServiceClient(); 4 public OrganizationBaseLine() 5 { 6 InitializeComponent(); 7 Loaded += new RoutedEventHandler(OrganizationBaseLine_Loaded); 8 } 9 10 void OrganizationBaseLine_Loaded(object sender, RoutedEventArgs e) 11 { 12 13 Metrics.GetAllDepartmentsCompleted += new EventHandler(Metrics_GetAllDepartmentsCompleted); 14 Metrics.GetAllDepartmen

      M Offline
      M Offline
      Mark Salsbery
      wrote on last edited by
      #2

      I'm missing something here....where is the problem? Is this a WCF problem or a database access problem? You showed WCF configuration....is that from the client side or the server side? What does the other end's configuration look like?

      Mark Salsbery Microsoft MVP - Visual C++ :java:

      R 1 Reply Last reply
      0
      • M Mark Salsbery

        I'm missing something here....where is the problem? Is this a WCF problem or a database access problem? You showed WCF configuration....is that from the client side or the server side? What does the other end's configuration look like?

        Mark Salsbery Microsoft MVP - Visual C++ :java:

        R Offline
        R Offline
        ravi vellanky
        wrote on last edited by
        #3

        Thanks Mark for the reply. Problem is while adding service reference to the silverlight application in ServiceReference.ClientConfig file it shows the end points properly. That means no problem with WCF Service. In the WCFTESTCLIENT also I tested, It works very well. But when I bind the service method in the pageloading event to a silverlight combobox control, It is showing the following error..... Unhandled Error in Silverlight 2 Application An exception occurred during the operation, making the result invalid. Check InnerException for exception details. at System.ComponentModel.AsyncCompletedEventArgs.RaiseExceptionIfNecessary() at MNetMetricSystem.Metrics.GetAllDepartmentsCompletedEventArgs.get_Result() at MNetMetricSystem.OrganizationBaseLine.Met_GetAllDepartmentsCompleted(Object sender, GetAllDepartmentsCompletedEventArgs e) at MNetMetricSystem.Metrics.MNetMetricsServiceClient.OnGetAllDepartmentsCompleted(Object state)

        M 1 Reply Last reply
        0
        • R ravi vellanky

          Thanks Mark for the reply. Problem is while adding service reference to the silverlight application in ServiceReference.ClientConfig file it shows the end points properly. That means no problem with WCF Service. In the WCFTESTCLIENT also I tested, It works very well. But when I bind the service method in the pageloading event to a silverlight combobox control, It is showing the following error..... Unhandled Error in Silverlight 2 Application An exception occurred during the operation, making the result invalid. Check InnerException for exception details. at System.ComponentModel.AsyncCompletedEventArgs.RaiseExceptionIfNecessary() at MNetMetricSystem.Metrics.GetAllDepartmentsCompletedEventArgs.get_Result() at MNetMetricSystem.OrganizationBaseLine.Met_GetAllDepartmentsCompleted(Object sender, GetAllDepartmentsCompletedEventArgs e) at MNetMetricSystem.Metrics.MNetMetricsServiceClient.OnGetAllDepartmentsCompleted(Object state)

          M Offline
          M Offline
          Mark Salsbery
          wrote on last edited by
          #4

          I can only guess with the given information. Looks like you need to debug your server so you can get more meaningful exception info. WHERE the exception is occurring would be helpful too. The exception message you posted mentions checking the inner exception... what's there?

          Mark Salsbery Microsoft MVP - Visual C++ :java:

          1 Reply Last reply
          0
          • R ravi vellanky

            Hi I'm using a wcf service to get the data from the database and bind it silverlight control. And below is the code sample that i've written. Problem here is WCF service that i've created is on basichttpbinding. Silverlight supports only this binding I think. So I changed the end point in my WCF service from default (wsHTTPbining ) to basic. when i add the service reference to the silverlight application the following is the silverlight clientconfig I'm getting with the error that i got when i build the application. <configuration> <system.serviceModel> <bindings> <basicHttpBinding> <binding name="BasicHttpBinding_ITestWCF" maxBufferSize="2147483647" maxReceivedMessageSize="2147483647"> <security mode="None" /> </binding> </basicHttpBinding> </bindings> <client> <endpoint address="http://localhost:8731/TestWCFLib/basic" binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_ITestWCF" contract="testService.ITestWCF" name="BasicHttpBinding_ITestWCF" /> </client> </system.serviceModel> </configuration> Unhandled Error in Silverlight 2 Application An exception occurred during the operation, making the result invalid. Check InnerException for exception details. at System.ComponentModel.AsyncCompletedEventArgs.RaiseExceptionIfNecessary() at MNetMetricSystem.testService.GetBugCountCompletedEventArgs.get_Result() at MNetMetricSystem.OrganizationBaseLine.obj_GetBugCountCompleted(Object sender, GetBugCountCompletedEventArgs e) at MNetMetricSystem.testService.TestWCFClient.OnGetBugCountCompleted(Object state) public partial class OrganizationBaseLine : UserControl 2 { 3 ServiceReference1.MNetMetricsServiceClient Metrics = new MNetMetricSystem.ServiceReference1.MNetMetricsServiceClient(); 4 public OrganizationBaseLine() 5 { 6 InitializeComponent(); 7 Loaded += new RoutedEventHandler(OrganizationBaseLine_Loaded); 8 } 9 10 void OrganizationBaseLine_Loaded(object sender, RoutedEventArgs e) 11 { 12 13 Metrics.GetAllDepartmentsCompleted += new EventHandler(Metrics_GetAllDepartmentsCompleted); 14 Metrics.GetAllDepartmen

            E Offline
            E Offline
            Edbert P
            wrote on last edited by
            #5

            Are you using DataTable? (From the looks of it your WCF returns DataTable) Silverlight does not support DataSet and DataTable, therefore your WCF has to return the result as an ICollection, e.g. List, ArrayList. Edbert Sydney, Australia

            R 1 Reply Last reply
            0
            • E Edbert P

              Are you using DataTable? (From the looks of it your WCF returns DataTable) Silverlight does not support DataSet and DataTable, therefore your WCF has to return the result as an ICollection, e.g. List, ArrayList. Edbert Sydney, Australia

              R Offline
              R Offline
              ravi vellanky
              wrote on last edited by
              #6

              Thanks for the reply Ebert, I returned list only from the wcf service. Is there any alternative way to get data from the database without WCF service? Ravi Vellanki, AP,India.

              1 Reply Last reply
              0
              Reply
              • Reply as topic
              Log in to reply
              • Oldest to Newest
              • Newest to Oldest
              • Most Votes


              • Login

              • Don't have an account? Register

              • Login or register to search.
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • World
              • Users
              • Groups