943,910 Members | Top Members by Rank

Ad:
  • VB.NET Discussion Thread
  • Marked Solved
  • Views: 145628
  • VB.NET RSS
You are currently viewing page 1 of this multi-page discussion thread
Apr 6th, 2006
0

How Do I Get Value Selected From ComboBox?

Expand 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
Similar Threads
Reputation Points: 37
Solved Threads: 17
Junior Poster
manal is offline Offline
122 posts
since Mar 2006
Apr 6th, 2006
0

Re: How Do I Get Value Selected From ComboBox?

Hi,

x=combobox.text

Loren Soth
Reputation Points: 28
Solved Threads: 4
Posting Whiz in Training
Lord Soth is offline Offline
233 posts
since Mar 2006
Oct 17th, 2006
0

Re: How Do I Get Value Selected From ComboBox?

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
Reputation Points: 28
Solved Threads: 4
Posting Whiz in Training
Lord Soth is offline Offline
233 posts
since Mar 2006
Jul 20th, 2007
0

Re: How Do I Get Value Selected From ComboBox?

Click to Expand / Collapse  Quote originally posted by manal ...
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!!!
Reputation Points: 10
Solved Threads: 1
Newbie Poster
salmansulaiman is offline Offline
2 posts
since Jul 2007
Sep 22nd, 2008
0

Re: How Do I Get Value Selected From ComboBox?

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.
Reputation Points: 10
Solved Threads: 1
Newbie Poster
ZachMack is offline Offline
1 posts
since Sep 2008
Sep 22nd, 2008
0

Re: How Do I Get Value Selected From ComboBox?

thank you all especailly to ZachMack who remind me of my first post here
and welcome to DaniWeb.
Reputation Points: 37
Solved Threads: 17
Junior Poster
manal is offline Offline
122 posts
since Mar 2006
Jun 9th, 2009
0

Re: How Do I Get Value Selected From ComboBox?

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
Reputation Points: 10
Solved Threads: 0
Newbie Poster
ad65222 is offline Offline
3 posts
since Jun 2009
Jul 1st, 2009
0

Re: How Do I Get Value Selected From ComboBox?

i think its combobox.selecteditem.tostring
Reputation Points: 10
Solved Threads: 1
Newbie Poster
eloelo22 is offline Offline
6 posts
since Jul 2009
Jul 1st, 2009
0

Re: How Do I Get Value Selected From ComboBox?

or like these combobox.selectedvalue.tosrting
Reputation Points: 10
Solved Threads: 1
Newbie Poster
eloelo22 is offline Offline
6 posts
since Jul 2009
Mar 4th, 2010
0
Re: How Do I Get Value Selected From ComboBox?
This Will work for sure
TextBox2.Text = ComboBox1.Items(0)
Reputation Points: 10
Solved Threads: 0
Newbie Poster
ghelghely is offline Offline
1 posts
since Mar 2010

This thread is solved

Either the thread starter or a moderator has marked this thread as solved. You can most likely trust the responses and answers given. There is most likely no reason for any further responses to be posted here. If you have a related question, please start a new thread in this forum instead.

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
This thread is currently closed and is not accepting any new replies.
Previous Thread in VB.NET Forum Timeline: backgroundworker in vb.net
Next Thread in VB.NET Forum Timeline: I really need help . Randomise Selections from Listbox





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC