> Hi
>
> The reason is that Row("Contact_Type") returns an object. Cast is as an
> integer and it will be OK:
>
> Select Case Row("Contact_Type").ToString
> Case "Main"
> .....
> End Select
>
>
> --
Hi
The reason is that Row("Contact_Type") returns an object. Cast it as a
string or use the objects .to string method when apropriate and it will be
OK
Select Case ctype(Row("Contact_Type",string)
Select Case cstr(Row("Contact_Type")
or just
Select Case Row("Contact_Type").ToString
AFAIK this problems should have also occured in previous versions of VS when
option strict is On
The bether code has Option explicit , and Options strict on above every code
block
Regards
Michel Posseth
"Eric Moreau" <(E-Mail Removed)> schreef in bericht
news:%(E-Mail Removed)...
> Hi
>
> The reason is that Row("Contact_Type") returns an object. Cast is as an
> integer and it will be OK:
>
> Select Case Row("Contact_Type").ToString
> Case "Main"
> .....
> End Select
>
>
> --
>
>
> HTH
>
> Éric Moreau, MCSD, Visual Developer - Visual Basic MVP
> Conseiller Principal / Senior Consultant
> S2i web inc. (www.s2i.com)
> http://emoreau.s2i.com/
>
> "John" <(E-Mail Removed)> wrote in message
> news:%(E-Mail Removed)...
>> Hi
>>
>> I have a vs 2003 project which I have just imported into vs 2005. Now I
>> am getting the "Option Strict On disallows operands of type Object for
>> operator '='. Use the 'Is' operator to test for object identity." error
>> on the 'Case "Main"' statement in the below code;
>>
>> Select Case Row("Contact_Type")
>> Case "Main"
>> .....
>> End Select
>>
>> What is the problem and how can I fix it?
>>
>> Thanks
>>
>> Regards
>>
>
>