加入傻瓜表 [英] Joining tables for dummies

查看:101
本文介绍了加入傻瓜表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述





我一直在研究实现连接的方法,我认为它应该是相当标准的但是我发现的一些帖子我并不完全关注。



我基本上有3个表,我们称之为Customer,OrderHeaders和OrderDetails,就像Beth Massi的教程一样。

I想要按客户和客户详细信息屏幕(当我选择客户时出现)进行搜索,我希望在OrderHeaders与订单上的OrderDetails一起在单个网格中加入OrderHeaders。



我能得到的最好的是客户详细信息屏幕上标签页中两个单独页面上的OrderHeaders和OrderDetails,就像OrderHeaders与OrderDetails无关。



现在我尝试创建一个视图,但由于某种原因,即使刷新或加载新项目,LS也无法看到该视图。这实际上也很奇怪,但有可能以某种方式覆盖某个地方的查询或以某种聪明的
方式使用设计师吗?我无法弄清楚如何关联或"导入" OrderDetails进入OrderHeaders网格........
$


我只使用了LS几天,所以和我一起裸露。

Hi

I've been researching ways to implement joins, I think it should be quite standard but the few post I've found I don't fully follow.

I have basicly 3 tables, let's call them Customer, OrderHeaders and OrderDetails just like in the tutorials by Beth Massi.
I want to search by customer and on the customer details screen (which appears when I select the customer) I want on the bottom row OrderHeaders joined with the OrderDetails on OrderHeader.Id in a single grid.

The best I can get is the OrderHeaders and OrderDetails on two seperate pages in a tabsheet on the customer details screen as though OrderHeaders are not related with the OrderDetails.

Now I've tried creating a view, but for some reason the view cannot be seen by LS even when refreshing or loading a new project. That's actually very strange as well, but is it possible to somehow override a query somewhere or using the designer in some clever way? I can't figure out how to relate or "import" the OrderDetails into the OrderHeaders grid........

I've only been using LS for a few days, so bare with me.

推荐答案

使用LightSwitch提供的内置控件,您将无法使OrderHeaders在同一数据网格中与OrderDetails结合使用。 LightSwitch提供的数据网格控件实现不支持行详细信息。如果您希望OrderHeaders
和OrderDetails都显示在同一数据网格中,那么您将必须创建自己的自定义控件。

You won't be able to get OrderHeaders joing with OrderDetails in the same data grid using the built-in controls provided by LightSwitch. The data grid control implementation provided by LightSwitch does not support row details. If you want both OrderHeaders and OrderDetails to both show in the same data grid, then you'll have to create your own custom control.

但是,您可以拥有在一个数据网格中收集OrderHeaders,并在第二个数据网格中包含OrderHetails的集合,由OrderHeaders集合的SelectedItem约束。

You can, however, have the collection of OrderHeaders in one data grid and have the collection of OrderDetails, constrained by the SelectedItem of the OrderHeaders collection, in a second data grid.


这篇关于加入傻瓜表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆