仅显示datagrid C#中的选定数据 [英] show only selected data in datagrid c#

查看:66
本文介绍了仅显示datagrid C#中的选定数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我如何仅显示我在form1上登录时所使用的卡号仅显示所选行.卡号是在form3 show.cardnumber.

how would i only show only selected row by cardnumber that i logged in with on form1. the cardnumber is passed and called in form3 show.cardnumber.

推荐答案

中传递和调用的,如果它是ASP,则可以将cardNumber作为参数发送,并在SQL语句中填充数据网格,您可以添加以下内容:
其中cardNumber =''+ Parameter_you_send +''
或对于C#Windows App.您可以将cardnumber值发送到datagrid表单中的Textbox或Label,并应用相同的"Where"语句.
Well, if it is ASP you can send the cardNumber as a Parameter and in your SQL statement for the filling of the datagrid you add something like:
Where cardNumber='' +Parameter_you_send+''
Or for C# Windows App. You can send the cardnumber value to a Textbox or Label in the datagrid Form, and apply the same ''Where'' Statement...


..

将您的卡号从第一种形式发送到第二种形式..

如果要使用数据表显示数据,请使用以下代码:

Hi there..

Send your card number from the first form to second form..

If you are using datatable to display the data then use this code:

DataRow[] dr=dataTable.Select("ColumName = "+cardNo);



一切顺利.



All the best..


这篇关于仅显示datagrid C#中的选定数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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