title: how to pass two parameters to call a stored procedure through c# mvc function
body: <p>I can do it easily when I need to pass a single parameter as follows:</p>
  
  <pre><code> public ProjectsModel GetProjectListBySearch(int projectId)
      {
          try
          {
              using (_context = new Exo_ADBEntities())
              {
                  var getdetailprojectlist = _context.Database.SqlQuery&lt;ProjectsModel&gt;("exec dbo.[GetProjectListByID] @ProjectID", new SqlParameter("@ProjectID", projectId)).FirstOrDefault();
                  return getdetailprojectlist;
              }
  
          }
          catch (Exception)
          {
  
              throw;
          }
      }
  </code></pre>
  
  <p>This works nicely but when I try to do the same kind of thing but passing two parameters I find syntax error called invalid parameter Please help me to do this.Code when using two parameters are as follows</p>
  
  <pre><code> public List&lt;ProjectsModel&gt; GetProjectDetailsBySectorAndSubSector(int sectorid,int subsectorid)
      {
          try
          {
              using (_context = new Exo_ADBEntities())
              {
                  var projectbysectorandsubsector = _context.Database.SqlQuery&lt;ProjectsModel&gt;("exec dbo.[GetProjectDetailsBySectorAndSubSector] @sectorId,@subSectorId", new SqlParameter("@sectorId, @subSectorId", sectorid, subsectorid)).ToList();
                  return projectbysectorandsubsector;
              }
  
          }
          catch (Exception)
          {
  
              throw;
          }
      }
  </code></pre>