change your query...for more better results..
SqlCommand cmd1= new SqlCommand(" select * from insertdetails where username like '%"+TextBox1.Text+"%'",con);
and your code should be
SqlConnection con= new SqlConnection("Data Source...");
protected void Page_Load(object sender, EventArgs e)
{
string command = "select * from insertdetails";
BindEmployeeDetails(command);
}
protected void BindEmployeeDetails(string command)
{
con.Open();
SqlCommand cmd= new SqlCommand(command);
SqlDataAdapter da = new SqlDataAdapter(cmd, con);
DataSet ds= new DataSet();
da.Fill(ds,"insertdetails");
GridView1.DataSource = ds.Tables["insertdetails"];
GridView1.DataBind();
con.Close();
}
protected void Button1_Click(object sender, EventArgs e)
{
string command = "select * from insertdetails where username like '%"+TextBox1.Text+"%'";
BindndEmployeeDetails(command);
}