title: Call MySql stored procedure which take 2 parameters from asp.net core 2.2 web API controller
body: <p>What is a proper way of calling a stored procedure with 2 parameters and getting result back which contain 10 columns and 403 records.</p>
  
  <p>Below is the code I have written.</p>
  
  <pre><code>try
  {
  
      string startDate = procedureResource.StartDate.ToString("yyyy-MM-dd") + " 00:00:00";
      string endDate = procedureResource.EndDate.ToString("yyyy-MM-dd") + " 23:59:59";
  
      var FromDate = new MySqlParameter("@FromDate", startDate);
      var ToDate = new MySqlParameter("@ToDate", endDate);
      var financial = context.Query&lt;FinancialResource&gt;().FromSql("EXECUTE GetChargesFromToDate @FromDate,@ToDate", FromDate, ToDate).ToList();
      return financial;
  
  
  }
  catch(Exception ex) { Console.Write(ex);throw ex; }
  </code></pre>
  
  <p>and here is the exception </p>
  
  <blockquote>
    <p>{"You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ''2019-09-28 00:00:00','2019-10-04 23:59:59'' at line 1"}</p>
  </blockquote>