All pastes #733230 Raw Edit

Someone

public text v1 · immutable
·published 2007-10-11 17:13 UTC
rendered paste body
 String sqlConnString = ConfigurationManager.ConnectionStrings[connection that works].ConnectionString;
        SqlConnection conn = new SqlConnection(sqlConnString);
        SqlCommand cmd = new SqlCommand(query that works, conn);
        
        conn.Open();
        SqlDataReader dr = cmd.ExecuteReader();
        String desc = "No rows.";


        if (dr.HasRows)
        {
            desc = "more than 0.";
            //desc = dr[0].ToString(); // This is the part giving me issues.
        }
        conn.Close();