无法从 RIA 服务获取数据

发布于 2024-09-02 17:04:14 字数 834 浏览 1 评论 0原文

我正在尝试 SL4 和 RIA 服务。我遵循了使用 SL4 Business 模板提供的常见教程,但我不知道为什么当我运行该应用程序时,我不会从该服务获得任何结果。

我添加了一个 ADO.NET 模型,该模型连接到 Northwind 数据库,其中只有员工表,并且还创建了其域服务。

<sdk:DataGrid AutoGenerateColumns="False" Name="dataGrid1" MinHeight="100" ItemsSource="{Binding ElementName=employeeDomainDataSource, Path=Data}" />
            <riaControls:DomainDataSource AutoLoad="True" d:DesignData="{d:DesignInstance my1:Employee, CreateList=true}" Height="0" LoadedData="employeeDomainDataSource_LoadedData" Name="employeeDomainDataSource" QueryName="GetEmployeesQuery" Width="0">
                <riaControls:DomainDataSource.DomainContext>
                    <my:NorthwindContext />
                </riaControls:DomainDataSource.DomainContext>
            </riaControls:DomainDataSource>

I'm trying the SL4 and RIA Services out. I followed the common tutorials available using SL4 Business template but I don't know why when I run the app I won't get any results from the service.

I have added a ADO.NET model which is connected to Northwind database and has only Employees table in it and also created its domain service.

<sdk:DataGrid AutoGenerateColumns="False" Name="dataGrid1" MinHeight="100" ItemsSource="{Binding ElementName=employeeDomainDataSource, Path=Data}" />
            <riaControls:DomainDataSource AutoLoad="True" d:DesignData="{d:DesignInstance my1:Employee, CreateList=true}" Height="0" LoadedData="employeeDomainDataSource_LoadedData" Name="employeeDomainDataSource" QueryName="GetEmployeesQuery" Width="0">
                <riaControls:DomainDataSource.DomainContext>
                    <my:NorthwindContext />
                </riaControls:DomainDataSource.DomainContext>
            </riaControls:DomainDataSource>

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

任性一次 2024-09-09 17:04:14

好的。我的错!我尚未将 AutoGenerateColumns 属性设置为 true

Ok. My fault! I have not set the AutoGenerateColumns property to true

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文