title: Tran_Venue_GetVenueOccupancyReports' expects parameter '@StartDate', which was not supplied
body: <p>Following is my C# code to call the stored procedure. Although i am creating and passing the parameter to stored procedure, i am still getting parameter not supplied error message. </p>
  
  <pre><code>   public DataSet GetOccVenueDetailsForReportsDAL(long ClassID, long VenueID, DateTime StartDate, DateTime EndDate)
          {
              return ExecuteDataSet("Tran_Venue_GetVenueOccupancyReports", ParamBuilder.Par("ClassID", ClassID), ParamBuilder.Par("VenueID", VenueID), ParamBuilder.ParDate("StartDate", StartDate), ParamBuilder.ParDate("EndDate", EndDate));
  
          }
  </code></pre>
  
  <p>Stored Procedure</p>
  
  <pre><code>ALTER PROCEDURE [dbo].[Tran_Venue_GetVenueOccupancyReports] --null,56
      (
      @VenueID BIGINT = NULL,
      @ClassID BIGINT = NULL,
      @StartDate DATETIME,
      @EndDate DATETIME
      )
  
  AS
  BEGIN 
  --SET FMTONLY OFF
  --declare @StartDate as DATETIME;
  CREATE TABLE #TempTable1(SessionID BIGINT,[SessionTime] DATETIME) 
  
  While @StartDate &lt;= @EndDate
  BEGIN 
          INSERT INTO #TempTable1( SessionTime )
          VALUES  ( @StartDate)
  
      SET @StartDate = DATEADD(minute,30,@StartDate)
  END
  
  SELECT Distinct V.ID as 'VenueID', V.PrimaryName AS 'VenueName', 
          CRS.ID as 'CourseID', CRS.PrimaryName as 'CourseName',
          CLS.ID as 'ClassID', CLS.PrimaryClassTitle as 'ClassTitle',
          --temp.[SessionTime] AS 'AvailableTime', 
          CONVERT(CHAR(16), s.StartTime, 120) + ' - ' + CONVERT(CHAR(16), s.EndTime,   120) AS AvailableTime,
          temp2.[SessionTime] AS 'OccupiedTime'
          FROM dbo.Venues V
          --LEFT OUTER JOIN dbo.Tran_CourseVenues CRV ON V.ID = CRV.VenueID AND CRV.IsDeleted = 0 AND CRV.IsActive = 1
          LEFT OUTER JOIN dbo.VenueOpenMapping CT ON V.ID = CT.OpenId AND CT.IsDeleted = 0 AND CT.IsActive = 1
          LEFT OUTER JOIN dbo.TMS_classes CLS ON CT.OpenId = CLS.ID AND CLS.IsDeleted = 0 AND CLS.IsActive = 1
          LEFT OUTER JOIN dbo.TMS_Courses CRS ON CLS.CourseID = CRS.ID AND CRS.IsDeleted = 0 AND CRS.IsActive = 1
          LEFT OUTER JOIN dbo.TMS_Sessions S ON CT.ID = S.VenueID AND CT.OpenId = S.ClassID AND s.IsDeleted = 0 AND s.IsActive = 1
          LEFT JOIN #TempTable1 Temp ON S.StartTime &lt;= Temp.[SessionTime] AND S.EndTime &gt;= Temp.[SessionTime] 
          LEFT JOIN #TempTable1 Temp2 ON S.StartTime &gt;= Temp.[SessionTime] AND S.EndTime &lt;= Temp.[SessionTime] 
  
  WHERE (V.IsDeleted = 0 AND V.IsActive = 1) 
          AND (@VenueID IS NULL OR @VenueID = 0 OR CT.VenueID = @VenueID )
          AND (@ClassID IS NULL OR CLS.ID = @ClassID)
          --AND (cls.id=0
          --GROUP BY v.Name,CLS.StartTime,CLS.EndTime
  
  END
  </code></pre>