I am having problems with the code below:

        protected override void AddAppointment(FxAppointmentData data)
{

            EventEntry appt = new EventEntry(data.Subject);

            appt.Times.Add(new When(data.BeginDateTime,
data.EndDateTime));
            appt.Times[0].AllDay = data.AllDayEvent;

            ExtendedProperty prop = new ExtendedProperty();

            prop.Name = "FlexScheduleID";
            prop.Value = data.ID.ToString();

            appt.ExtensionElements.Add(prop);

            _UriCalendar = new Uri("http://www.google.com/calendar/
feeds/" + _GoogleCalID + "/private/full");


            AtomEntry ae = new AtomEntry();
            ae = _calService.Insert(_UriCalendar, appt);


        }

It works fine, I can even add several events, and even do it to two
calendars at the same time.  However, when I go back to the Google
Calendar website, and do a refresh or move an event around, the next
time I try to add another event, I get this exception:

+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Google.GData.Client.GDataRequestException was unhandled
  Message="Execution of request failed:
http://www.google.com/calendar/feeds/[EMAIL PROTECTED]/private/full"
  Source="Google.GData.Client"
  StackTrace:
       at Google.GData.Client.GDataGAuthRequest.Execute(Int32
iRetrying)
       at Google.GData.Client.GDataGAuthRequest.Execute()
       at Google.GData.Client.Service.StreamInsert(Uri feedUri,
AtomBase baseEntry, GDataRequestType type)
       at Google.GData.Client.Service.Insert(Uri feedUri, AtomEntry
newEntry)
       at
WindowsApplication10.FxDataStoreGoogle.AddAppointment(FxAppointmentData
data) in C:\Documents and Settings\Robert Maxey\My Documents\Visual
Studio Projects\WindowsApplication10\WindowsApplication10\Data
\FxDataStoreGoogle.cs:line 86
       at
WindowsApplication10.FxAcidBase.AddAppointmentAndNotify(FxAppointmentData
data) in C:\Documents and Settings\Robert Maxey\My Documents\Visual
Studio Projects\WindowsApplication10\WindowsApplication10\Data
\FxAcidBase.cs:line 39
       at WindowsApplication10.frmGoogleCal.ultraButton1_Click(Object
sender, EventArgs e) in C:\Documents and Settings\Robert Maxey\My
Documents\Visual Studio Projects
\WindowsApplication10\WindowsApplication10\CtlsAndForms
\frmGoogleCal.cs:line 64
       at System.Windows.Forms.Control.OnClick(EventArgs e)
       at Infragistics.Win.UltraControlBase.OnClick(EventArgs e)
       at Infragistics.Win.Misc.UltraButtonBase.OnClick(EventArgs e)
       at Infragistics.Win.Misc.UltraButton.OnMouseUp(MouseEventArgs
e)
       at System.Windows.Forms.Control.WmMouseUp(Message& m,
MouseButtons button, Int32 clicks)
       at System.Windows.Forms.Control.WndProc(Message& m)
       at
System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
       at
System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
       at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr
hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
       at
System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
       at
System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(Int32
dwComponentID, Int32 reason, Int32 pvLoopData)
       at
System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32
reason, ApplicationContext context)
       at
System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32
reason, ApplicationContext context)
       at System.Windows.Forms.Application.Run(Form mainForm)
       at WindowsApplication10.Program.Main() in C:\Documents and
Settings\Robert Maxey\My Documents\Visual Studio Projects
\WindowsApplication10\WindowsApplication10\Program.cs:line 23
       at System.AppDomain.nExecuteAssembly(Assembly assembly,
String[] args)
       at System.AppDomain.ExecuteAssembly(String assemblyFile,
Evidence assemblySecurity, String[] args)
       at
Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
       at System.Threading.ThreadHelper.ThreadStart_Context(Object
state)
       at System.Threading.ExecutionContext.Run(ExecutionContext
executionContext, ContextCallback callback, Object state)
       at System.Threading.ThreadHelper.ThreadStart()
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

When I look at the inner exception I see this message:

{"The underlying connection was closed: A connection that was expected
to be kept alive was closed by the server."}

The Response and ResponseString are null in the outer exception, and
the inner exception.

I must need to reinitialize something, and I have tried re-
authorizing, and even creating a new Calendar service object.

Thanks for your help!

Bob


--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to