check below code with few best practice
string sql ="select reg_date_time,first_name,last_name,birth_date,address,pincode,mobile,form_no,user_name from registration where form_no = @fromno";
using(SqlConnection con = new SqlConnection(connectionString))
using(SqlCommand cmd = new SqlCommand(sql),con)
{
cmd.Parameters.AddWithValue("@fromno", int.Parse(Request.QueryString["id"].ToString()));
con.Open();
using(SqlDataReader dr = cmd.ExecuteReader())
{
if(dr.HasRows())
{
if(dr.Read())
{
txt_datetime.Text = dr.GetString(dr.GetOrdinal("reg_date_time"));
}
}
}
}
if you need specific solution you need to give full error details