Hello everyone! I am using .NET library to get all events from all my
calendars. I get calendars just fine. But when I try to create
EventFeed for each calendar, it fails. Please take a minute to look at
this simple code and tell me what could be wrong. Thanks in advance.
================================================================
CalendarService service = new CalendarService("Calendar");
service.setUserCredentials("myusername", "mypassword");
// Retrieving all calendars
CalendarQuery calendarQuery = new CalendarQuery("http://www.google.com/
calendar/feeds/default/allcalendars/full");
CalendarFeed calendarFeed = service.Query(calendarQuery);
// Retrieve events for each calendar
foreach (CalendarEntry calendarEntry in calendarFeed.Entries) {
// MY QUESTION IS HERE:
// How to get THE RIGHT URL for each calendar, so that I can retrieve
events from it?
// The address below will result in exception further in code (see
below...)
var address = calendarEntry.EditUri.Content;
EventQuery eventQuery = new EventQuery(address);
// Starting from today, I need 10 upcoming events max
eventQuery.FutureEvents = true;
eventQuery.SingleEvents = true;
eventQuery.NumberToRetrieve = 10;
// FAILS HERE WITH THIS EXCEPTION:
// Execution of request failed:
http://www.google.com/calendar/feeds/default/allcalendars/full/[EMAIL
PROTECTED]&futureevents=true&singleevents=true
EventFeed eventFeed = service.Query(eventQuery);
foreach (EventEntry eventEntry in eventFeed.Entries) {
// Retrieving events information here...
}
}
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Google Calendar Data API" group.
To post to this group, send email to
[email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/google-calendar-help-dataapi?hl=en
-~----------~----~----~----~------~----~------~--~---