查询显示记录从数据库明智的词 [英] query for display record word wise from database

查看:59
本文介绍了查询显示记录从数据库明智的词的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

请帮助我查询数据库中的显示记录..
例如:假设我要显示苹果词,如果我在文本框中输入A,然后在网格视图控件中显示所有以"A"开头的记录,那么我输入"p"将显示所有以"AP"开头的记录,依此类推..最后删除所有其他单词,并在网格视图控件中仅显示单词"APPLE".

请帮我这个东西.

谢谢

please help me in query for display record from database ..
Ex: suppose i want to display apple word if i input A in the text box then display all record that start with "A" in grid view control,then i input "p" display all record that start with "AP" end so on..at the end remove any other word and display only word "APPLE" in grid view control.

please help me in this stuff.

Thank you

推荐答案

嗨索米尔,

首先运行此查询

从测试名称中选择*,例如"A%"之类的

现在用它填充数据集,并通过绑定源"将其绑定到gridview.
要使用"p"或任何其他单词进一步移动,可以使用Binding Source Filter属性,如
Hi Somil,

First run this query

Select * from Test Where Name Like ''A%''

Now fill dataset with it and bind it to gridview through Binding Source.
For move further with ''p'' or any other word you can use Binding Source Filter property like
<code>
BindingSource bs = new BindingSource();
bs.DataSource = DS.Table[0];
bs.Filter = "Name like ''AP%''";

</code>



您可以根据搜索更改"AP%".

问候
Ankit



You can change ''AP%'' according to search.

Regards
Ankit


从<表名=">中选择*其中< field name =">像''%< word>%''

例如:
--------

1.选择* From Emp,其中EmpName类似于%A"
以A开头的记录

2.选择*从Emp中,EmpName类似于"A%"
以A结尾的那些记录

3.选择*从Emp中,EmpName类似于''%A%''
包含A
的那些记录
4.选择*从Emp中,EmpName类似于"__%"
2 CharMin的那些记录



Sql中的通配符

Windows%喜欢的百分比* [Char Check通配符]
_在Windows中喜欢吗? [Char Lenght Check Wild Card]

Vb.NET使用通配符[%TO *,_ To _]</word></field></table>
Select * from <table name=""> Where <field name=""> Like ''%<word>%''

Ex:
--------

1. Select * From Emp Where EmpName Like ''%A''
Those Records Which Start With A

2. Slect * From Emp Where EmpName Like ''A%''
Those Records Which End With A

3. Slect * From Emp Where EmpName Like ''%A%''
Those Records Which Contains With A

4. Slect * From Emp Where EmpName Like ''__%''
Those Records Which 2 CharMin



Wild Card in Sql

% in Windows LIke * [Char Check Wild Card]
_ in Windows LIke ? [Char Lenght Check Wild Card]

Vb.NET Using Wild Card [% TO *,_ To _]</word></field></table>


这篇关于查询显示记录从数据库明智的词的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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