hai all
i want to populate grid view with data from sql server tables.
the tables are as follows:
first table: Profile:
Id Name Age Designation_code
1 ABC 22 3
2 DEF 24 2
3 GHI 25 1
4 JKL 23 3
5 MNO 22 3
6 PQR 25 2
Second Table: Designation:
D_id Designation_name Designation_code
1 Consultant E1
2 Project Lead E2
3 Programmer E3
the result in the grid view should be this way
D_id Designation_name Employees
1 Consultant GHI
2 Project Lead DEF
PQR
3 Programmer ABC
JKL
MNO
the sql code i used is as follows
SELECT p.Id,d.Designation_name,p.Name as Employee
FROM profile p
LEFT OUTER JOIN Designation d
ON p.Designation_code=d.Designation_code
I know the sql for the result but.. the result is displayed like this
D_id Designation name Employees
1 Consultant GHI
2 Project Lead DEF
3 Project Lead PQR
4 Programmer ABC
5 Programmer JKL
6 Programmer MNO
i want the result as i showed. what should i do to get the data of two tables in the grid view this way
D_id Designation name Employees
1 Consultant GHI
2 Project Lead DEF
PQR
3 Programmer ABC
JKL
MNO
please help me thanks in advance