using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using System.Data.OleDb;

public partial class memseek : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {

    }
    protected void btnseek_Click(object sender, EventArgs e)
    {
      string strcon = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=|DataDirectory|mydata.mdb";
      OleDbConnection conn = new OleDbConnection(strcon);
      string sql0 = "select * from members where mname='" + txtname.Text + "'";
      OleDbDataAdapter oda = new OleDbDataAdapter(sql0, conn);
      DataSet ds = new DataSet();
      oda.Fill(ds);
      if (ds.Tables[0].Rows.Count > 0)
      {
        gdvmem.DataSource = ds;
        gdvmem.DataBind();
        gdvmem.Visible = true;
        lblmes.Visible = false;
      }
      else
      {
        gdvmem.Visible = false;
        lblmes.Visible = true;
      }
    }
}
