We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Help creating RecurrencePattern from database

I am trying to store a string (or two if necessary) to indicate the recurrence pattern of a "location" task.

Here is the dataset:




and here is the source code:

SqlConnection dbCon = new SqlConnection(WebConfigurationManager.ConnectionStrings["dbuniSHRED"].ConnectionString);


SqlCommand sqlCmd = new SqlCommand("usp_locationschedule_GetLocationsForInsert", dbCon);

sqlCmd.CommandType = CommandType.StoredProcedure;

SqlDataAdapter adapter = new SqlDataAdapter(sqlCmd);

DataSet ds = new DataSet();


foreach (DataRow dbRow in ds.Tables[0].Rows)


string sStart = dbRow["sRecurrenceStart"].ToString();

string sRecurrence = dbRow["sRecurrencePattern"].ToString();

RecurrencePattern pattern = new RecurrencePattern(sStart + "\n" + sRecurrence);

DateCollection dates = pattern.GenerateOccurrences();

foreach (DateTime d in dates)





The RecurrencePattern(sStart + "\n" + sRecurrence); looks well formed, but dates always comes back with a count of 0. I'm trying to test with Every Monday starting on October 2, 2006 with no end date.

Please help!

If you are using evaluation version (without a license), the range of generated dates is limited to 2000 I think. This is mentioned in the documentation for GenerateOccurrences I think.