Your code almost right.
You have given exact match condition. May be user input was wrong
See one more wrong input is here you are using TextBoxLongName textbox for input and search and this TextBoxINST_ID for to populate result. Hope so this is wrong so you have change this this.
protected void TextBoxLongName_TextChanged(object sender, EventArgs e)
{
SqlConnection con2 = new SqlConnection(System.Configuration.ConfigurationManager.ConnectionStrings["HotConnectionString"].ConnectionString);
con2.Open();
SqlCommand scmd2 = new SqlCommand("Select INST_ID, LongName from Table23 where LongName = '" + TextBoxLongName.Text + "'", con2);
SqlDataReader dr2 = scmd2.ExecuteReader();
if (dr2.Read())
{
TextBoxINST_ID.Text = dr2["INST_ID"].ToString();
}
dr2.Close();
con2.Close();
}
}
}