当选择id号时,如何从datagridview中的记录组中显示单个记录 [英] How to diaplay a single record from group of records in datagridview when id number is selected
本文介绍了当选择id号时,如何从datagridview中的记录组中显示单个记录的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我在datagridview中获取了组的详细信息..请帮助我在选择id no时如何在datagridview中显示单个记录
I'm getting the details of group in the datagridview.. please help me how to diaplay a single record in datagridview when id no is selected
推荐答案
你需要更改您的查询以获取只有一条记录的详细信息。如下所示...
You need to change your query to get the details of only one record. Something like below...
SELECT someColumn, someOtherColumn,
FROM
TableName
WHERE
Id = @SelectedRecordId
假设DataGridView由DataTable提供,请设置DataTable的DefaultView的RowFilter属性。
Assuming the DataGridView is fed by a DataTable, set the RowFilter property of the DataTable's DefaultView.
这篇关于当选择id号时,如何从datagridview中的记录组中显示单个记录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文