private void bttok_click(object sender, System.EventArgs e) { SqlCommand myCommand = new SqlCommand("select * from employee where txtname.text=id",con); SqlDataAdapter myAdapter=new SqlDataAdapter(myCommand); DataSet ds = new DataSet(); myAdapter.Fill(ds); con.Open(); myCommand.ExecuteNonQuery(); datagrid1.DataSource=ds; datagrid1.DataBind(); con.Close();