模糊查询

Posted .NET应用开发教程

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了模糊查询相关的知识,希望对你有一定的参考价值。

  string sql = "select * from  Users where UserName like ‘%‘[email protected]+‘%‘ or UserID like ‘%‘[email protected]+‘%‘";
            SqlParameter[] p = { new SqlParameter("@UserName", txt),
                             new SqlParameter("@UserID", txt),};
            DataTable dt = SQLHelper.ExecuteDataTable(sql, p);
            Repeater1.DataSource = dt;
            Repeater1.DataBind();

 

以上是关于模糊查询的主要内容,如果未能解决你的问题,请参考以下文章