string connString = "Provider=Microsoft.Jet.OleDb.4.0;Data Source=";
            connString += Server.MapPath("~/jinhai.mdb");
            OleDbConnection conn = new OleDbConnection(connString);
            string seStr = "select * from kehu where user_name like @user_name";
            OleDbCommand comm = new OleDbCommand(seStr, conn);
            string name = "%" + txtName1.Text.ToString().Trim() + "%";
            comm.Parameters.AddWithValue("@user_name", name);
            conn.Open();
            OleDbDataReader dr = comm.ExecuteReader();
            if (dr.HasRows)
            {
                myReapeter.DataSource = dr;
                myReapeter.DataBind();
            }
            else
            {
                this.Page.ClientScript.RegisterStartupScript(this.GetType(), "afsdgfdh", "alert('没有此客户的任何记录!');", true);
            }
            dr.Close();
            conn.Close();

相关文章:

  • 2021-11-28
  • 2021-11-27
  • 2021-12-04
  • 2021-06-11
  • 2021-09-23
  • 2021-07-04
  • 2021-06-08
猜你喜欢
  • 2021-11-02
  • 2021-11-05
  • 2022-12-23
  • 2023-03-29
  • 2021-11-28
相关资源
相似解决方案