Click here to Skip to main content
15,888,461 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
How to populate listbox from database on textbox textchanged event and select value store into database .

Example:


I have one table tblAccount
Fields are:
appAccountID
appAccountName
appParentID
appCreatedDate

I want this type of output:
appAccountID appAccountName appParentID appCreatedDate
1 Home 0 28-07-2012
2 Office 0 28-07-2012
3 Salary 2 29-07-2012
4 Vegetables 1 29-07-2012

when i want to add my home expences into home accountName then i write down in txtSearchAccount after writing home it will display home's all subcategory
when i select home then it will store appParentID = home's Primary key .
Please help me .

Thank you in advance.
Posted

You can handle this event, and you can write any code you like in the event handler. Where are you stuck ?
 
Share this answer
 
How to populate listbox from database on textbox textchanged event and select value store into database
Steps:
1. Define TextChanged event in your code behind file
2. Based on whatever search criteria is passed, use to form a search query
3. Retrieve data from database based on the query
4. Display the data in listbox based on data retrieved.

Go step by step, try out and post specific issue once faced. You may find that it was not that difficult.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900