Click here to Skip to main content
15,916,842 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
i have one table

empid empname empmanagerid
1001 jay 1002
1002 sudhakar 1003


so now i want if i select empid in textbox empmanagerid should be display in dropdown.


pls help me i tried a lot its not coming
Posted
Updated 14-Sep-11 2:04am
v2

Use below select query to fill the drop down.

SQL
select e1.empmanagerid , e2.empname , e2.empid
from Employee E1 inner join Employee E2
on e1.empid = e2.empmanagerid
 
Share this answer
 
Comments
jayanthik 14-Sep-11 8:37am    
my table name is tbl_emp i have 1 table only
As i understood
you want to display empmanagerid in dropdown when you type empid in texbox

If that is the case then your query should be as follows

SELECT empmanagerid FROM EMPTABLE WHERE empid='your typed text in textbox'
 
Share this answer
 
v2
Comments
jayanthik 14-Sep-11 8:40am    
i have to display empmanager name in dropdown
P.Salini 14-Sep-11 8:43am    
then you can use the query in solution1 and add where condition to it
SQL
select  e2.empname from Employee e1 inner join Employee e2
on e2.empid = e1.empmanagerid where e1.empid='your text in textbox'
 
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