Results 1 to 4 of 4

Thread: The Difference is bewtween....

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Dec 2002
    Posts
    382

    The Difference is bewtween....

    Since I have option strict on in all my work, I find that I'm converting and casting constatly because of it. Pulling data out of a datareader, whats the diference between these two??

    VB Code:
    1. 'Should I do it this way??
    2. Acct.AcctPass = CStr(r("AcctPass"))
    3.  
    4. 'Or this way??
    5. Acct.AcctPass = CType(r("AcctPass"), String)

  2. #2
    Your Ad Here! Edneeis's Avatar
    Join Date
    Feb 2000
    Location
    Moreno Valley, CA (SoCal)
    Posts
    7,339
    CStr is part of the Visual Basic namespace and is a port of the VB6 function instead of a native .NET version that does the same thing like CType. (I think)

  3. #3

    Thread Starter
    Hyperactive Member
    Join Date
    Dec 2002
    Posts
    382
    Originally posted by Edneeis
    CStr is part of the Visual Basic namespace and is a port of the VB6 function instead of a native .NET version that does the same thing like CType. (I think)
    Thx Edneeis...

  4. #4
    Sleep mode
    Join Date
    Aug 2002
    Location
    RUH
    Posts
    8,083
    Originally posted by Edneeis
    CStr is part of the Visual Basic namespace and is a port of the VB6 function instead of a native .NET version that does the same thing like CType. (I think)
    .It's one of the .Net Framework functions .

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