473,396 Members | 1,693 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

loading dropdown

hi, i have a value like 'AM,AS,Testing' in the database. on the page load i need to load the dropdown with the above values but each as an individual entry, like AM as one entry in the dropdown, AS as 2nd dropdown value, Testing as the last option in the dropdown. can any one helpme out there?
Sep 3 '07 #1
2 853
dip_developer
648 Expert 512MB
hi, i have a value like 'AM,AS,Testing' in the database. on the page load i need to load the dropdown with the above values but each as an individual entry, like AM as one entry in the dropdown, AS as 2nd dropdown value, Testing as the last option in the dropdown. can any one helpme out there?
if yopur string is comma separated then split it with String.Split() method and add each element in the dropdown...the code will look like.....Please verify the code......I am giving you the idea.....hope it will help you


Expand|Select|Wrap|Line Numbers
  1.  Dim s2 As String="AM,AS,Testing" 
  2. Dim stringSeparators() As String = {","}
  3. Dim result() As String
  4. result = s2.Split(stringSeparators, StringSplitOptions.RemoveEmptyEntries)
  5.  
  6. For i=0 To result.Length-1
  7. DropDownList1.Add(result(i))
  8. Next i
  9.  
Sep 3 '07 #2
thanks for the reply. its working but while adding each item i need to check whether there is any duplicate value in the already existing items. how can i do that?

if yopur string is comma separated then split it with String.Split() method and add each element in the dropdown...the code will look like.....Please verify the code......I am giving you the idea.....hope it will help you


Expand|Select|Wrap|Line Numbers
  1.  Dim s2 As String="AM,AS,Testing" 
  2. Dim stringSeparators() As String = {","}
  3. Dim result() As String
  4. result = s2.Split(stringSeparators, StringSplitOptions.RemoveEmptyEntries)
  5.  
  6. For i=0 To result.Length-1
  7. DropDownList1.Add(result(i))
  8. Next i
  9.  
Sep 4 '07 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Joseph Barron | last post by:
Here is a SIMPLE problem that I'm trying to solve. It works in Netscape 6.2, but IE6 gives ""No such interface supported." Below are page1.htm and page2.htm . In page1.htm, there are two...
0
by: anonymous | last post by:
Thanks Michelle, How could I achieve the second one.I do not like Flashing windows in response to selection of an item. I agree the data transfer is very little but the same data transferred for...
3
by: Bala | last post by:
Hi, In my page there is 4 dropdown list boxes.when page loading that time i am loading the nearly 3000 items array. so its taking too much time to load. is it other way fill up the dropdown...
1
by: RAJ | last post by:
Hi, I am working on a source code written earlier in VB.net.While loading some forms(already created with some controls on it), I am getting the following error:...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.