1-demensional array string cannot be converted to integer

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • spud379
    New Member
    • Mar 2007
    • 11

    1-demensional array string cannot be converted to integer

    i am doing an assignment in vb.net. i have to select at random from and array what i have is

    dim country(29) as string
    dim random as new random

    txtcountry.text = random.next(cou ntry)


    I keep getting that this error
    1-demensional array string cannot be converted to integer

    can anyone help?

    thanks
  • RedSon
    Recognized Expert Expert
    • Jan 2007
    • 4980

    #2
    random usually returns a number or integer in this case you are trying to put an integer into some kind of text object which I would assume to be a string. You will need to convert that integer to a string and then put it in that text property. I dont know how to do that since I'm not a VB programmer. You can post this int he VB forum if you like.

    Comment

    Working...