You have taken the words right out of my mouth... The exception you
are encountering is a runtime exception thrown by VB.NET to indicate
that o could not be cast to an ExtendedProperty.

In VB, you need to do the test first, than cast. In C# you cast, and
see if the cast was successfull by testing for NULL afterwards.

Frank Mantek

On 11/28/06, Tormod <[EMAIL PROTECTED]> wrote:
>
> That's probably because the 'As' keyword from VB is not equivalent to
> the 'as' keyword from C#. In C#, the snippet
>
> String str = object as String;
>
> is equivalent to
>
> String str;
> if(object is String)
>     str = (String) object;
> else
>     str = null;
>
> On Nov 27, 11:33 pm, "Sunita" <[EMAIL PROTECTED]> wrote:
> > thanks...i still have a problem..In the link that you gave me there is
> > a line of code that goes like this
> >
> > ExtendedProperty p = o as ExtendedProperty;
> >
> > when i use this code in my application i get and invalid cast
> > exception....here o is an object and p is an extendedproperty...i am
> > coding in vb.net....Do you know where the problem can be??
>
>
> >
>

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