ASP.NET with C# and SQL Server

almoplava1

New Member
Attendence_Stu_Main {table1}\[code\]Att_id varchar(50)P.k, st_rollno varchar(50)st_name varchar(50)branch_name varchar(50)sem_no intbatch_year varchar(50)batch_name varchar(50)scode varchar(50)sess_no intattendence int total int\[/code\]Attendence_Stu_MainL1 {table2}\[code\]st_id varchar(50) p.k.st_rollno varchar(50),st_name varchar(50),branch_name varchar(50),sem_no int,batch_year varchar(50),batch_name varchar(50),scode varchar(50),sess_no int,attendence int, total int\[/code\]I have been using below query in a \[code\]SqlDataSource\[/code\] in ASP.NET\[code\]query = @"SELECT DISTINCT Attendence_Stu_Main.st_id, Attendence_Stu_Main.st_rollno, Attendence_Stu_Main.st_name, Attendence_Stu_Main.scode, Attendence_Stu_Main.attendence AS Theory, Attendence_Stu_Main.total As Total, Attendence_Stu_MainL1.attendence AS Lab, Attendence_Stu_MainL1.total AS Total1 FROM Attendence_Stu_Main LEFT OUTER JOIN Attendence_Stu_MainL1 ON Attendence_Stu_Main.st_id = Attendence_Stu_MainL1.st_id AND Attendence_Stu_Main.scode = Attendence_Stu_MainL1.scode ORDER BY Attendence_Stu_Main.scode,Attendence_Stu_Main.st_rollno";\[/code\]above query shows output in this form in GridVIew:---\[code\]st_id st_rollno st_name subject Theory Total Lab Total1--------------------------------------------------------------------------------086001 IT001 PRANAV mat 21 22 11 14086002 IT002 DEEP mat 21 22 11 14086001 IT001 PRANAV sci 20 24 09 12086002 IT002 DEEP sci 21 24 08 12\[/code\]I want my output as below, using SQL Server and ASP.NET controls features, if anyone could help me..\[code\]st_id st_rollno st_name subject Theory Total Lab Total1---------------------------------------------------------------------------------------086001 IT001 PRANAV mat,sci 21,20 22,24 11,09 14,12086002 IT002 DEEP mat,sci 21,21 22 ,24 11,08 14,12\[/code\]
 
Back
Top