I want to create a Table Adapter in C# as follows.
I wish to use same filed in a table twice with different conditions, and it must be shown as two diff
SELECT A.StudentID, A.Studname, A.StudSex, A.StudCourse,
SUM(CASE WHEN A.AttendStatus = 'Present' THEN 1 ELSE 0 END) AS TotalPresent,
SUM(CASE WHEN A.AttendStatus = 'Absent' THEN 1 ELSE 0 END) AS TotalAbsent
FROM AttendanceReg A
INNER JOIN LocalTable L ON A.StudCourse = L.AttendCourse AND DatePart('M', A.DateOfAttendance) = L.AttentMonth)
GROUP BY A.StudentID, A.Studname, A.StudSex, A.StudCourse