Retreiving data from database to dropdownlist

Posted by Saritha.rajeshkumar under C# on 4/29/2011 | Points: 10 | Views : 2893 | Status : [Member] | Replies : 1
hi this is saritha,
i have used array for dropdownlist and inserted the value in database, when i was retreiving tha value to edit from database to dropdownlist iam getting all the values in dropdownlist which are there in arrays.
i want to display the value which was there in database.


Posted by: Sashys on: 4/30/2011 [Member] Starter | Points: 25

Hi Saritha,

Let me understand you issue first.. You have assigned some values in to Array list and you did bind that value to Dropdown. You are also able to insert those values in to Db. When you try to read that values, you don't see your db values, instead you see array list values.
is that correct? if so, you may need to clear the array list and see if you are assigning values to drop down in every post back using page_load.
Arraylistobject.items.clear() will clear the array list.

if you are using array instead of arraylist, please use array list. If not working, please explain your issue once again clearly.

Sasikumar .M

Saritha.rajeshkumar, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response