刷新数据网格 [英] Refreshing data grid
本文介绍了刷新数据网格的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
Am使用 TableMapping
将数据加载到数据网格.如下
Am using TableMapping
to load data to a data grid. as below
daCompanies.TableMappings.Add("tbl_permits", "companies")
我有一个刷新按钮,它仅调用与最初将数据加载到数据网格上相同的功能.刷新在上面的代码处停止,并出现错误:
I have a refresh button that just calls the same function used to initially load the data on the data grid. The refresh stops at the code above with an error:
The DataTableMapping.SourceTable is required to be unique, ''tbl_permits'' already exists in the collection.
如何清除 DataTableMapping.SourceTable
上的更改或将更改保存到数据库并在重新加载数据之前将其清除?
谢谢
How do i clear OR save changes on the DataTableMapping.SourceTable
to database and clear it before reloading it with data?
Thanks
推荐答案
再次阅读错误消息.当您一次只能映射一个表时,您试图添加同一表的两个映射.要么删除映射表的行,要么在尝试添加映射之前检查该映射是否已经存在.
Read the error message again. You''re trying to add two mappings of the same table, when you can only map a table once. Either remove the line that''s mapping the table, or check to see if the mapping already exists before you try to add it.
这篇关于刷新数据网格的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文