コード例 #1
0
        public static DataSet GetEvents(
            int moduleId,
            DateTime beginDate,
            DateTime endDate)
        {
            StringBuilder sqlCommand = new StringBuilder();

            SqliteParameter[] arParams = new SqliteParameter[3];
            arParams[0] = new SqliteParameter(":ModuleID", DbType.Int32);
            arParams[1] = new SqliteParameter(":BeginDate", DbType.DateTime);
            arParams[2] = new SqliteParameter(":EndDate", DbType.DateTime);

            arParams[0].Direction = ParameterDirection.Input;
            arParams[0].Value     = moduleId;


            sqlCommand.Append("SELECT  * ");
            sqlCommand.Append("FROM	mp_CalendarEvents ");
            sqlCommand.Append("WHERE ");
            sqlCommand.Append("ModuleID = :ModuleID ");

            sqlCommand.Append("AND EventDate >= :BeginDate ");
            arParams[1].Direction = ParameterDirection.Input;
            arParams[1].Value     = beginDate;


            sqlCommand.Append("AND EventDate <= :EndDate ");
            arParams[2].Direction = ParameterDirection.Input;
            arParams[2].Value     = endDate;

            sqlCommand.Append(" ;");

            return(SqliteHelper.ExecuteDataset(
                       GetConnectionString(),
                       sqlCommand.ToString(),
                       arParams));
        }