Hello Everyone,
I got two tables Table Employee : Eno , Ename ,Sal and Table Works_on :Designation Hours_Worked Eid.Now in a page I took a dropdownlist to combine ename and designation and I wrote the below query in datasource select e.ename,wo.designation from employee e,works_on wo where e.eno = wo.eid;
Now the thing is that what should I specify in datatextfield and value field I want to get ename||designation.If I don't specify anything then I am not able to bind data.
Is there any other way to do it.
Regards,
Sita.
Loading
Jignesh TrivediPosted Sep 16, 2013, 2:40 AM
hi,
what I understand from your quesition is you want show conbine text of name and designation in drop down.
right?
if yes then you can write query which combine both the filed.
like...
select e.ename + ' || ' + wo.designation as empName from employee e,works_on wo where e.eno = wo.eid;
this will return empName list which is assign to datatextfield property of dropdown list.
hope this will help you.
Sanjeeb LenkaPosted Sep 16, 2013, 1:51 PM
sita kPosted Sep 16, 2013, 12:05 PM
Thanks for your reply. I tried the below query in dropdownlist sqldatasouce and set textfield to empName but getting an error invalid number.
select e.ename + ' || ' + wo.designation as empName from employee e,works_on wo where e.eno = wo.eid;
Sita.
Sanjeeb LenkaPosted Sep 16, 2013, 2:31 AM
i didn't get your point plz provide more clear details with some sample data.
if you want to show emp name in dropdown then bind it to textfield.
and designation to value field. Which value you want to access just assign it to textfield.