Question : linq

I am trying to display data froma sql server DB in silverlight3

I followed this link http://www.codeproject.com/KB/silverlight/Silverlight3_SQL_WCF.aspx

and I get an error with the return list as it cant return a list.

Error    1    Value of type 'System.Collections.Generic.List(Of sql.Web.one)' cannot be converted to 'System.Collections.Generic.List(Of sql.Web.Service1.StudentInfo)'.  


'''''''''''''''''''''''''''''''''''''''''

'service1.svc


<ServiceContract(Namespace:="")> _
<AspNetCompatibilityRequirements(RequirementsMode:=AspNetCompatibilityRequirementsMode.Allowed)> _
Public Class Service1

    <OperationContract()> _
 Public Function filldata() As List(Of StudentInfo)
        Dim db As New sql.Web.DataClasses1DataContext

        Dim results = From p In db.ones _
                      Select p

        Return results.ToList


    End Function


    Public Class StudentInfo

        Public id As String
        Public subject As String
     
    End Class
End Class

'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
'''main.xaml.vb

    Private Sub but2_click(ByVal sender As System.Object, ByVal e As RoutedEventArgs)

       

        Dim webservice3 As New sql.ServiceReference1.Service1Client


        AddHandler webservice3.filldataCompleted, AddressOf webservice_filldatacompleted

        webservice3.filldataAsync()
    End Sub
    Public Sub webservice_filldatacompleted(ByVal sender As Object, ByVal e As ServiceReference1.filldataCompletedEventArgs)


        dg1.ItemsSource = e.Result


    End Sub


Answer : linq

advise them that they could use Experts Exchange *laughing*).

>> GEM !!
Random Solutions  
 
programming4us programming4us