如何更新父/子关系信息? [英] How to UPDATE parent / child relation information?
问题描述
我想问一下是否有人可以帮助我了解如何更新我的孩子关系。我有一个客户表,然后是帐户表,帐户是孩子。我可以成功地将信息保存到客户表:
me.validate()
me.CustomersBindingSource.Endedit()
me.CustomersAccountsBindingSource.Endedit()孩子
me.TableAdapterManager1.UpdateAll(me.Shopdataset)
我不喜欢在运行程序时,我的datagridviews上显示的信息有问题。在关闭程序然后重新启动程序后,我可以看到我的客户数据存在,但所有客户的帐户数据都丢失了。
提前谢谢。
我尝试了什么:
我试过更新全部绑定源。我还尝试添加绑定导航器并使用保存按钮插入标准工具,并尝试使用保存按钮进行保存。
I would like to ask if someone could please help me to understand how to update the child relation that I have. I have a "customers" table and then "accounts" table and the accounts is the child. I can successfully save information to the customers table:
me.validate()
me.CustomersBindingSource.Endedit()
me.CustomersAccountsBindingSource.Endedit() "child"
me.TableAdapterManager1.UpdateAll(me.Shopdataset)
I don't have an issue displaying the information on my datagridviews when I am running the program. After I have closed the program and then restarted the program, I can see that I customers data is there but all the customer's account data is missing.
Thank you in advance.
What I have tried:
I have tried updating all of the binding sources. I have also tried to add a binding navigator and inserted the standard tools with the save button, and tried using the save button to save.
推荐答案
基于以下文章: 演练:保存相关数据表中的数据(分层更新) [ ^ ] - 您必须更改分层更新
属性为true
。
试试!
Based on this article: Walkthrough: Saving Data from Related Data Tables (Hierarchical Update)[^] - you have to changeHierarchical Update
property totrue
.
Try!
这篇关于如何更新父/子关系信息?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!