Hi All,
I have ap problem related to database and combobox..
i have a combo box which retrives the number of UserID from Database as
1
2
3
4
5
6
7
8
Now what i need to do is , if i select 3 from Combobox, then Userid1 ,Userid2, UserID3,
Should get selected and if 2 then Userid1 and userId2 Sholuld get selected from database...
Its very urgent...plz...help :(
Thanks in advance
4 replies to this topic
#1
Posted 25 August 2010 - 02:45 AM
|
|
|
#2
Posted 25 August 2010 - 06:36 AM
Add integers to combo box using Items.Add() method. Avoid adding strings, but rather add integers because you'll operate with integers later.
Handle the SelectedIndexChanged event of combo box if you wish to do some work immediately after combo box selection changes. Use SelectedItem property to retireve the integer which is selected.
Use DropDownStyle property to forbid/allow user to type values in combo box.
Use DataSource and DisplayMember properties to load contents of the combo box from a collection (e.g. array of objects retrieved from database).
Handle the SelectedIndexChanged event of combo box if you wish to do some work immediately after combo box selection changes. Use SelectedItem property to retireve the integer which is selected.
Use DropDownStyle property to forbid/allow user to type values in combo box.
Use DataSource and DisplayMember properties to load contents of the combo box from a collection (e.g. array of objects retrieved from database).
#3
Posted 26 August 2010 - 01:37 AM
hi,
i have binded the combobox with numbers from 1 to 8 as number of data in database and also have a collection of data from database.
now if i select 3 from combobox it should display 3 userid as userid1,userid2,userid3.... how to do dis..i m not getiing it.
i have binded the combobox with numbers from 1 to 8 as number of data in database and also have a collection of data from database.
now if i select 3 from combobox it should display 3 userid as userid1,userid2,userid3.... how to do dis..i m not getiing it.
#4
Posted 27 August 2010 - 02:53 AM
I am not getting what you want to get from that code ? :(
#5
Posted 27 August 2010 - 08:01 AM
jkjavedpro said:
hi,
i have binded the combobox with numbers from 1 to 8 as number of data in database and also have a collection of data from database.
now if i select 3 from combobox it should display 3 userid as userid1,userid2,userid3.... how to do dis..i m not getiing it.
i have binded the combobox with numbers from 1 to 8 as number of data in database and also have a collection of data from database.
now if i select 3 from combobox it should display 3 userid as userid1,userid2,userid3.... how to do dis..i m not getiing it.
Do you have the code where you are attempting to get the values from the database? Can you post it?
1 user(s) are reading this topic
0 members, 1 guests, 0 anonymous users


Sign In
Create Account

Back to top









