请教vb代码怎样写?

海涵德 2010-10-23 08:32:45
这是“Silverlight WCF RIA服务 (三)创建一个RIA Services Solution”中的一段
  LoadOperation<?XML:NAMESPACE PREFIX = [default] http://schemas.microsoft.com/winfx/2006/xaml/presentation NS = "http://schemas.microsoft.com/winfx/2006/xaml/presentation" /><customer> loadOp = this._customerContext.Load(this._customerContext.GetCustomersQuery());

CustomerGrid.ItemsSource = loadOp.Entities;
...全文
87 8 打赏 收藏 转发到动态 举报
写回复
用AI写文章
8 条回复
切换为时间正序
请发表友善的回复…
发表回复
海涵德 2010-10-25
  • 打赏
  • 举报
回复
关于WCF不能在iis7上不能使用的问题以前发过帖子,就是在iis7上部署的项目中有关WCF的部分失效。以前的帖子说的详细:
http://topic.csdn.net/u/20100928/21/edf10a31-723b-445e-96d2-06d6c7ec4b64.html
jv9 2010-10-25
  • 打赏
  • 举报
回复
问题解决了就好。 :)

"sl3项目在iis7部署问题解决了,但出现了WCF功能有不能用了",怎么出现WCF不能用了?
海涵德 2010-10-24
  • 打赏
  • 举报
回复
但是在VB中就不行,没有返回结果
Partial Public Class MainPage
Inherits UserControl
Private _customerContext As CustomerDomainContext = New CustomerDomainContext()

Public Sub New()
InitializeComponent()

' CustomerGrid.ItemsSource = _customerContext.Load(_customerContext.GetCustomerQuery()).Entities

CustomerGrid.ItemsSource = Me._customerContext.Load(_customerContext.GetCustomerQuery()).Entities
End Sub

End Class
海涵德 2010-10-24
  • 打赏
  • 举报
回复
我把代码改成:
 public partial class MainPage : UserControl
{
private CustomerDomainContext _customerContext = new CustomerDomainContext();

public MainPage()
{
InitializeComponent();

//LoadOperation<?XML:NAMESPACE PREFIX = [default] http://schemas.microsoft.com/winfx/2006/xaml/presentation NS = "http://schemas.microsoft.com/winfx/2006/xaml/presentation" /><customer> loadOp = this._customerContext.Load(this._customerContext.GetCustomersQuery());

CustomerGrid.ItemsSource = this._customerContext.Load(_customerContext.GetCustomerQuery()).Entities;


}
}

就有正确结果了。
海涵德 2010-10-24
  • 打赏
  • 举报
回复
也许这一段代码错了,我在sharp中也没有调试成,谁有正确的代码。
代码来自文章:http://www.silverlightchina.net/html/tips/2010/0815/1728.html
jv9 2010-10-24
  • 打赏
  • 举报
回复
你的VB.NET代码没错,看看Domain返回数据了么?
(_customerContext.GetCustomerQuery()有返回么?Debug一下。
海涵德 2010-10-24
  • 打赏
  • 举报
回复
vb代码几分钟后也调试成功了,问题出在 CustomerGrid(datagrid 控件)上,简单调整一下记录就出来了,当时不能发多于3个以上帖子,只有现在再补了。
前几天安装了vs2010和silverlight4,正在体会Silverlight WCF RIA架构,这些对于程序员都不是问题,问题可能还是关于部署的问题,但愿别在出现vs2008+sl3中遇到序列化、部署等问题,这些问题纠缠了我好长时间,至今还有遗留问题,虽然sl3项目在iis7部署问题解决了,但出现了WCF功能有不能用了,最后只好使用ii6部署sl3项目了,这样服务器只能使用WindowsXP/Windows Server 2003操作系统了,对于Windows 7/Windows Server 2008只有寄希望于vs2010+sl4了。
老Key 2010-10-23
  • 打赏
  • 举报
回复
不会vb只会。net和sl。。。只好帮你顶了。呵呵。。

8,735

社区成员

发帖
与我相关
我的任务
社区描述
WPF/Silverlight相关讨论
社区管理员
  • WPF/Silverlight社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧