title: Unable to cast object of type 'System.Data.SqlClient.SqlDataReader' to type 'System.IConvertible'
body: <p>Hi I've been having the same error as the title says. I don't know why what's wrong. I'm still new to this so, I'm not really sure how to solve this. If anyone can help me, I would appreciate it and if possible please provide me some codes that needs to be replaced. Thank you.</p>
  
  <hr>
  
  <pre><code>public DataTable getAllLoanInfoDT()
  { 
      using (SqlConnection conn = new SqlConnection(connString))
      {
          SqlCommand cmd2 = new SqlCommand();
          cmd2.Connection = conn;
          // cmd.CommandType = CommandType.StoredProcedure;
          cmd2.CommandText = "SELECT DISTINCT loanUpdateDate FROM LoanPortfolio WHERE (custID LIKE 'OH00002') AND (loanType LIKE 'Personal Loan')"; 
          cmd2.Parameters.AddWithValue("@custID", "OH00002");
          cmd2.Parameters.AddWithValue("@loanType", "Personal Loan");
          conn.Open();
          SqlDataReader myReader = cmd2.ExecuteReader();
          DateTime loanUpdateDate = Convert.ToDateTime(myReader);
          DateTime currDateTime = DateTime.Now;
  
          int loanToBeAdded = (((currDateTime.Year - loanUpdateDate.Year) * 12) + currDateTime.Month - loanUpdateDate.Month) * 500;
          if (loanToBeAdded &gt; 0)
          {
              String sql = "UPDATE LoanPortfolio SET loanPaid = loanPaid + " + loanToBeAdded.ToString() + ", loanUpdateDate = " + DateTime.Now.ToString();
              sql += " WHERE (loanType LIKE 'Personal Loan') AND (custID LIKE 'OH00002')";
  
              //Execute the above query here
          }
          conn.Close();
  
          using (SqlDataAdapter dAd = new SqlDataAdapter("SELECT * FROM LoanPortfolio where custID like 'OH00002'", conn))
          {
              DataTable dTable = new DataTable();
              dAd.Fill(dTable);
              return dTable;
          }
      }
  }
  </code></pre>