Results 1 to 3 of 3

Thread: [RESOLVED] [02/03] Can't use 'Or' in an if statement.

  1. #1

    Thread Starter
    Member
    Join Date
    Feb 2005
    Posts
    61

    Resolved [RESOLVED] [02/03] Can't use 'Or' in an if statement.

    VB Code:
    1. if data.Tables("ResolutionTable").Rows(iter).Item(1).ToString.CompareTo("0") Or _
    2. data.Tables("ResolutionTable").Rows(iter).item(1).ToString.CompareTo("") Or _
    3. [u]IsNothing(data.Tables("ResolutionTable").Rows(iter).Item(1).ToString)[/u] Then
    The portion that I've underlined is where the error is occuring (as it is what is underlined in VS .NET.) The error message is:
    Code:
    Option Strict On disallows implicit conversions from 'Boolean' to 'Integer'.
    Why is this happening?

    I'd like to stick to using option strict, since it enforces good programming practices.

  2. #2

    Thread Starter
    Member
    Join Date
    Feb 2005
    Posts
    61

    Re: [02/03] Can't use 'Or' in an if statement.

    Never mind, I figured it out.

  3. #3
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: [02/03] Can't use 'Or' in an if statement.

    Quote Originally Posted by YourSurrogateGod
    Never mind, I figured it out.
    Then please mark your thread as resolved from the Thread Tools menu.
    Last edited by jmcilhinney; Sep 11th, 2006 at 08:09 AM.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width