Home > Database > Mysql Tutorial > Like的一个小技巧 %%

Like的一个小技巧 %%

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-06-07 15:06:01
Original
1335 people have browsed it

(1)SelectCommand="SELECT [Admin], [AdPassword], [Purview] FROM [_Admin] where Admin like @Admin 注意改成like,并且不加%%号 (2)查询时用如下语句,注意写法. SqlDataSource1.SelectParameters["Admin"].DefaultValue = "%" + TextBox1.Text + "%"; Grid

(1)SelectCommand="SELECT [Admin], [AdPassword], [Purview] FROM [_Admin] where Admin like @Admin
注意改成like,并且不加%%号

(2)查询时用如下语句,注意写法.

  SqlDataSource1.SelectParameters["Admin"].DefaultValue = "%" + TextBox1.Text + "%";
        GridView1.DataBind();

--------------
最后说明一下:这就是微软的一个示例程序,这种方法同时适用于存贮过程,三层强类型数据集.


(1)如果不输入任何东西,就返回整个表中的数据.
(2)如果输入东西,那么按输入的东西进行查询. 

Related labels:
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Issues
Django's LIKE operation.
From 1970-01-01 08:00:00
0
0
0
Isn’t this iQiyi-like course finished? ?
From 1970-01-01 08:00:00
0
0
0
javascript - js cannot retrieve objects like this
From 1970-01-01 08:00:00
0
0
0
Why should I write it like this?
From 1970-01-01 08:00:00
0
0
0
How to open a developer tool like yours
From 1970-01-01 08:00:00
0
0
0
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template