Microsoft
Software
Hardware
Network
Question : linq
I am trying to display data froma sql server DB in silverlight3
I followed this link
http://www.codeproject.com
/KB/silver
light/
Silv
erlight3_S
QL_WCF.asp
x
and I get an error with the return list as it cant return a list.
Error 1 Value of type 'System.Collections.Generi
c.List(Of sql.Web.one)' cannot be converted to 'System.Collections.Generi
c.List(Of sql.Web.Service1.StudentIn
fo)'.
''''''''''''''''''''''''''
''''''''''
'''''
'service1.svc
<ServiceContract(Namespace
:="")> _
<AspNetCompatibilityRequir
ements(Req
uirementsM
ode:=AspNe
tCompatibi
lityRequir
ementsMode
.Allowed)>
_
Public Class Service1
<OperationContract()> _
Public Function filldata() As List(Of StudentInfo)
Dim db As New sql.Web.DataClasses1DataCo
ntext
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.Serv
ice1Client
AddHandler webservice3.filldataComple
ted, AddressOf webservice_filldatacomplet
ed
webservice3.filldataAsync(
)
End Sub
Public Sub webservice_filldatacomplet
ed(ByVal sender As Object, ByVal e As ServiceReference1.filldata
CompletedE
ventArgs)
dg1.ItemsSource = e.Result
End Sub
Answer : linq
advise them that they could use Experts Exchange *laughing*).
>> GEM !!
Random Solutions
Using 3rd Party SSL to Setup Exhange 2007, Outlook 2007, Server 2003 with Terminal Services
Javascript problem
execute onLoad only once in an ASP page
How do I configure OWA internal/external URL's?
URGENT: Need help with ColdFusion.Window.onHide
Save only sends e-mail with removed attachment again
Remove row if column B and C are empty
Cisco CME - One DID to display its own number in caller ID
WinForms in VS 2010
E72 - How to make email work without activating data services?