I am trying to select on 30 (this will be adjusted with a variable) records at a time. The selection works when I am not Joining two of my tables,
When I add the following JOIN, the Datagrid tells me that the field c.[Followup] does not exist.
There is no problem with the other JOIN
my problem is with this code??
Is this conflicting with my JOIN's?
When I add the following JOIN, the Datagrid tells me that the field c.[Followup] does not exist.
Code:
JOIN CallerTask1 c ON a.National_id = c.National_idCode:
Student a right JOIN QUALIFICATION b ON a.[id] = b.[id] )Code:
WITH CTE AS ( SELECT *, ROW_NUMBER() OVER (ORDER BY ID) AS RowNumber FROM [StuentPlacement20131].[dbo].[Student] ) SELECT * FROM CTE WHERE RowNumber BETWEEN " & StartRow & " AND " & EndRow & "Code:
FieldsString = "a.[id] , a.[National_Id] , a.[Alternative_Id_Type], a.[Person_Alternate_Id] ,a.[Person_First_Name] , " & _
"a.[Person_Middle_Name], a.[Person_Last_Name], a.[Equity_Code] , a.[Person_Birth_Date] , " & _
"a.[Person_Title] , a.[Gender_Code] ,a.[Citizen_Resident_Status_Code] , a.[Disability_Status_Code], " & _
"a.[Home_Language_Code], a.[Nationality_Code], a.[Socioeconomic_Status_Code], a.[Person_Home_Address_1] , " & _
"a.[Person_Home_Addr_Postal_Code],a.[Person_Home_Address_2], a.[Person_Home_Address_3], " & _
"a.[Person_Postal_Address_1], a.[Person_Postal_Addr_Post_Code], a.[Municipality], a.[Person_Postal_Address_2], " & _
"a.[Person_Postal_Address_3], a.[Province_Code], a.[Person_Phone_Number], a.[Person_Cell_Phone_Number], " & _
"a.[Person_Fax_Number], a.[Person_Email_Address], a.[Campus], a.[CollegeID], a.[Level_grade], " & _
"a.[MainSubject1], a.[MainSubject2], a.[MainSubject3], a.[Mainsubject4], a.[NOTES],c.[FollowUp] ,c.[Complete] ,c.[NoAnswer] ,c.[CallerHangUp] ,c.[CallBackPlease],c.[WrongNumber]"
FinalSQL_Str = " WITH CTE AS ( SELECT *, ROW_NUMBER() OVER (ORDER BY ID) AS RowNumber FROM [StuentPlacement20131].[dbo].[Student] ) SELECT * FROM CTE WHERE RowNumber BETWEEN " & StartRow & " AND " & EndRow & " " & _
"( SELECT distinct " & FieldsString & " FROM Student a right JOIN QUALIFICATION b ON a.[id] = b.[id] " & _
" JOIN CallerTask1 c ON a.National_id = c.National_id where " & SetaString & " " & finaltask & ")" myCommand = New SqlClient.SqlCommand(FinalSQL_Str & "order by [id]", con)
adp2 = New SqlDataAdapter(myCommand)
adp2.Fill(dt)
Grid_Select_Student_For_Edit.DataSource = dt





