谁能帮我实现.net页面的搜索功能,我悬赏100分

来源:百度知道 编辑:UC知道 时间:2024/06/05 06:24:18

。。得到控件上的所有字

循环所有控件 得到 wintext

发消息 不会了问我

什么叫“.net页面的搜索功能”啊

public static DataTable selUser(string uName, string uText//这里是你要搜索的字段)
{
StringBuilder str = new StringBuilder("select * from ["你要搜索的表名"]");
bool isw = false;
if (uName != null && uName != "")
{
str.Append(isw ? " and " : " where ")
.Append("uName like '%")//注意空格
.Append(uName)
.Append("%'");
isw = true;
}
if (uText != null && uText != "")
{
str.Append(isw ? " and " : " where ")
.Append("uText like '%")
.Append(uText)
.Append("%'");