First you need to get the Id from text box:-
int id = Convert.ToInt32(txtId.Text);
Then On button_Click :-
Protected void button_Click(object sender, EventArgs e)
{
SqlConnection con = new SqlConnection("your connection string");
SqlCommand cmd = new SqlCommand("SELECT * FROM [table_Name] WHERE Id=@Id",con)
cmd.Parameters.AddWithValue("@Id",id);
SqlDataAdapter da = new SqlDataAdapter(cmd);
DataSet ds = new DataSet();
da.Fill(ds);
detailsView1.DataSource = ds;
detailsView1.DataBind();
}
Hope it will help you.
Best of luck.