Results 1 to 2 of 2

Thread: problem with return a value from a list box

  1. #1

    Thread Starter
    Member
    Join Date
    Nov 2007
    Posts
    43

    problem with return a value from a list box

    hi
    How can return a value from a listbox that connected to a database.I used this code : "countrylistbox.items(2).toString " but the return value is this:"system.data.datarowview" .but if it doesn't connect to a database it works.
    i'm usign vb.net 2005
    thanks

  2. #2
    Junior Member
    Join Date
    Jul 2007
    Posts
    22

    Thumbs up Re: problem with return a value from a list box

    Hi,
    Is the list box showing the data correctly? or Are you facing some problem with Returning values?
    Since you are binding it to database, you should use SelectedValue/SelectedItem property for returning the values from listbox.
    If you are not binding it to db, your code will work.
    Try like countrylistbox.SelectedItem.

    Thanks.

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