DataGridView比较 [英] DataGridView Compare

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

问题描述

嗨!

我有个问题.我有两个DataGridViews.在DataGridView1中,我有一个名为名称"的列,在GridView2中,我有一个名为名称"的列,我执行一个存储过程,并执行从grid1到grid2的插入.

如果可以在grid2中找到相同的名称,如何使grid1中的行不可见?

Hi!

I have a question. I have two DataGridViews. In DataGridView1 I have a column named "Name" and in GridView2 I have a column named "Name" I execute a stored procedure and do an insert from grid1 to grid2.

How can I make the row from grid1 not visible if the same name can be found in grid2?

Thank You!!!

推荐答案

我希望最好的方法是过滤数据源中的数据.
The best way, I would expect, would be to filter the data in your data source.


好,您的问题不是很清楚,但是除了在UI级别进行过滤之外,您还可以在数据库级别执行相同的操作.仅从数据库中为不在Grid1中的Grid2获取那些行.
Well, your question is not quite clear, but other than filtering at UI level you can do the same at Database level. Fetch only those rows from database for Grid2 that is not in Grid1.


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

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