![](/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.