![](/img/trans.png)
[英]Data not showing on Silverlight controls in datagrid after setting itemsource
[英]silverlight datagrid not showing data
我有 silverlight 應用程序和 WCF 服務來訪問 sql 服務器數據庫中的表。 我從教程中復制了所有代碼並從我的桌面運行它。 它無法加載 sql 服務器數據,盡管其他一切都加載正常。 其他帖子談論http://localhost:PortNumber/Service1.svc是問題所在,我應該部署服務,而其他帖子則談論使用可觀察集合。 有沒有人解釋問題可能是什么以及如何糾正它。
Imports System.ServiceModel
Imports System.ServiceModel.Activation
公共 Class 服務1
<OperationContract()>
Public Function GetPostCounts() As List(Of RealTimePostCount)
' Add your operation implementation here
Dim db As New DataClasses1DataContext
Dim posts = (From record In db.RealTimePostCounts Order By record.boxCount, record.boxFeed, record.pollDate Select record)
Dim list As New List(Of RealTimePostCount)
For Each p In posts
list.Add(New RealTimePostCount With {.boxCount = p.boxCount, .boxFeed = p.boxFeed, .pollDate = p.pollDate})
Next
Return list
End Function
' Add more operations here and mark them with <OperationContract()>
結束 Class
服務引用..clientconfig
<configuration>
<system.serviceModel>
<bindings>
<basicHttpBinding>
<binding name="BasicHttpBinding_Service1" maxBufferSize="2147483647"
maxReceivedMessageSize="2147483647">
<security mode="None" />
</binding>
</basicHttpBinding>
</bindings>
<client>
<endpoint address="http://localhost:12018/Service1.svc" binding="basicHttpBinding"
bindingConfiguration="BasicHttpBinding_Service1" contract="ServiceReference1.Service1"
name="BasicHttpBinding_Service1" />
</client>
</system.serviceModel>
將問題分解成更小的部分。
希望這足以解決或引導您解決更具體的問題。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.