Results 1 to 3 of 3

Thread: ctype(objecttype, integer) doesn't work

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Oct 2003
    Posts
    436

    ctype(objecttype, integer) doesn't work

    dim o as object

    o = SqlHelper.ExecuteScalar(sConnectionString, "CountProductsByCategory", 2)

    rchTextbox.Text = CType(0, Integer)

    By executing the stored proc, I am successfully getting the desired value into the object variable "o" (say 12). but when I use ctype function to convert that into integer, it shows up as 0 (zero) in the rich text box.

    how can I do this convertion?
    thanks
    nath

  2. #2
    PowerPoster
    Join Date
    Mar 2002
    Location
    UK
    Posts
    4,780
    rchTextbox.Text = CType(0, Integer)


    ^^ I hope that this is an example, as that 0 is the number not the character.


    Also your textbox needs the string version, this below would do it, although there are other ways which Im sure other people will point out .

    rchTextbox.Text = CStr(o, Integer)

  3. #3

    Thread Starter
    Hyperactive Member
    Join Date
    Oct 2003
    Posts
    436

    thanks

    thanks.

    it works./

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