Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 How to bind values in formview using different pos

Author  Topic 

Pratigya
Starting Member

1 Post

Posted - 2011-11-15 : 08:36:56
I have two different tables one telephone with these columns [tel_id],[client_id],[tel_no],[tel_type_id],[details_type_id],[sort_no] where tel_id is the pk n client_id is fk and another table telephone_id with columns [tel_type_id],[tel_type_lib_fr] ,[tel_type_lib_en]. I dont know how to bind and display the telephone number to the formview according to the type. say if its type 1 then landline ; 2 _ mobile n if 3 fax

there's also another table called client where client_id is the pk. i've made a join in between these and a few more tables from the same db.

Thanks.

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2011-11-15 : 08:52:56
Use case when approach

select
case tel_typ_id
when 1 then 'landline'
when 2 then 'mobile'
when 3 then 'fax'
end
from .....


Madhivanan

Failing to plan is Planning to fail
Go to Top of Page
   

- Advertisement -