You can get the data by using this:
DataTable t = new DataTable();
using (SqlConnection c = new SqlConnection("pass your connection string here"))
{
c.Open();
using (SqlDataAdapter a = new SqlDataAdapter("Pass your Query Here", c))
{
a.Fill(t);
}
}
You can attach the data to the textbox by using this:
textBox1.Text=t.Rows[0][0].ToString();