How Do I Get Value Selected From ComboBox?

Please support our VB.NET advertiser: Programming Forums - DaniWeb Sister Site
Thread Solved

Join Date: Mar 2006
Posts: 122
Reputation: manal is an unknown quantity at this point 
Solved Threads: 17
manal's Avatar
manal manal is offline Offline
Junior Poster

How Do I Get Value Selected From ComboBox?

 
0
  #1
Apr 6th, 2006
Salam...
I need to get value that has been selected from combobox ..
the values in combobox is taken from column's contents of one of tabel in database..so once i write if x=combobox.selectedvalue..i got error that i Additional information: Operator is not valid for type 'DataRowView' and string
Reply With Quote Quick reply to this message  
Join Date: Mar 2006
Posts: 233
Reputation: Lord Soth is an unknown quantity at this point 
Solved Threads: 4
Lord Soth's Avatar
Lord Soth Lord Soth is offline Offline
Posting Whiz in Training

Re: How Do I Get Value Selected From ComboBox?

 
0
  #2
Apr 6th, 2006
Hi,

x=combobox.text

Loren Soth
Best regards,
Loren Soth

Crimson K. Software _________________________________________________________________ Crimson K. Blog
Reply With Quote Quick reply to this message  
Join Date: Mar 2006
Posts: 233
Reputation: Lord Soth is an unknown quantity at this point 
Solved Threads: 4
Lord Soth's Avatar
Lord Soth Lord Soth is offline Offline
Posting Whiz in Training

Re: How Do I Get Value Selected From ComboBox?

 
0
  #3
Oct 17th, 2006
Hi,

PHP is a server side web scripting language where you don't have direct access to client side web controls like text and combo boxes. What you should do is to put <input> tags in a <form action="POST"> tag with destination to another (to the same is also possible, slightly more complicated) PHP page where contents of the selected combobox item will be returned to the new PHP page as $_POST["nameofpostvar"] variable when submitted. On server side scripting each action requires a round trip to the server.

Loren Soth
Best regards,
Loren Soth

Crimson K. Software _________________________________________________________________ Crimson K. Blog
Reply With Quote Quick reply to this message  
Join Date: Jul 2007
Posts: 2
Reputation: salmansulaiman is an unknown quantity at this point 
Solved Threads: 1
salmansulaiman salmansulaiman is offline Offline
Newbie Poster

Re: How Do I Get Value Selected From ComboBox?

 
0
  #4
Jul 20th, 2007
Originally Posted by manal View Post
Salam...
I need to get value that has been selected from combobox ..
the values in combobox is taken from column's contents of one of tabel in database..so once i write if x=combobox.selectedvalue..i got error that i Additional information: Operator is not valid for type 'DataRowView' and string
Hey sorry but i dont know the ans to your Q. yours was the first query that came around so ...just asking you
I just wanted to know how do you go about this site...i mean...if i wanted to post a Q about JAVA etc...you see its an informative site but its tough moving in here...how do i do it???? if you can help me out...really appreciate it!!! thank you!!!
Reply With Quote Quick reply to this message  
Join Date: Sep 2008
Posts: 1
Reputation: ZachMack is an unknown quantity at this point 
Solved Threads: 1
ZachMack ZachMack is offline Offline
Newbie Poster

Re: How Do I Get Value Selected From ComboBox?

 
0
  #5
Sep 22nd, 2008
In VB, the combobox's value can be retrieved several ways. x=combobox.selectedvalue will return a row like the error says. What intellisense doesn't tell you is that you can retrieve the information from this row using .Item(0) so x=combobox.selectedvalue.item(0) will give you the value including the type like integer, etc.
Reply With Quote Quick reply to this message  
Join Date: Mar 2006
Posts: 122
Reputation: manal is an unknown quantity at this point 
Solved Threads: 17
manal's Avatar
manal manal is offline Offline
Junior Poster

Re: How Do I Get Value Selected From ComboBox?

 
0
  #6
Sep 22nd, 2008
thank you all especailly to ZachMack who remind me of my first post here
and welcome to DaniWeb.
"give only what u willing to receive "
Reply With Quote Quick reply to this message  
Join Date: Jun 2009
Posts: 3
Reputation: ad65222 is an unknown quantity at this point 
Solved Threads: 0
ad65222 ad65222 is offline Offline
Newbie Poster

Re: How Do I Get Value Selected From ComboBox?

 
0
  #7
Jun 9th, 2009
hi guys...i m new to coding and all ....can smone suggest me how to take values in list box and how to select an item(multiple selection also).....its important....please send me the code
Reply With Quote Quick reply to this message  
Join Date: Jul 2009
Posts: 6
Reputation: eloelo22 is an unknown quantity at this point 
Solved Threads: 1
eloelo22 eloelo22 is offline Offline
Newbie Poster

Re: How Do I Get Value Selected From ComboBox?

 
0
  #8
Jul 1st, 2009
i think its combobox.selecteditem.tostring
Reply With Quote Quick reply to this message  
Join Date: Jul 2009
Posts: 6
Reputation: eloelo22 is an unknown quantity at this point 
Solved Threads: 1
eloelo22 eloelo22 is offline Offline
Newbie Poster

Re: How Do I Get Value Selected From ComboBox?

 
0
  #9
Jul 1st, 2009
or like these combobox.selectedvalue.tosrting
Reply With Quote Quick reply to this message  
Reply

This thread has been marked solved.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the VB.NET Forum


Views: 54721 | Replies: 8
Thread Tools Search this Thread



Tag cloud for VB.NET
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC