在文本框中输入文本时,如何编码用于搜索datagrid中的记录的代码? [英] how do i code for searching records in datagrid when text entered in textbox?

查看:56
本文介绍了在文本框中输入文本时,如何编码用于搜索datagrid中的记录的代码?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

plz给我一些帮助..

如果我们从datagrid n搜索名字,我们就知道了..之后,我们必须找出那个名字的姓氏..为名字提取的记录应该保持原样,因为现在是n,我们必须找出我们得到的相同名字的姓氏在datagrid中.

plz send me some help..

if we r searching Firstname from datagrid n we got that.. afterwards we have to find out surname for that first name.. the records fetched for firstname should remain as it is n now we have to find out surname for the same firstname we got in datagrid..
then how we should code for it??

推荐答案

对数据库执行另一次搜索,将姓氏附加到所用的intial where子句字符串中.
例如[伪代码根据您自己的需要进行修复]

Perform another search on the database, appending the surname to the intial where clause string used.

e.g. [ Pseudocode fix up for your own needs ]

Dim query as string
if textSurname.text = string.empty then
    query = "Select Firstname From Names Where Firstname=''" + textFirstname +"''"
else
    query = "Select * From Names Where Firstname=''" + textFirstname + "'' AND Surname=''" + textSurname + "''"
end if


这篇关于在文本框中输入文本时,如何编码用于搜索datagrid中的记录的代码?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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