Quote:
PFLoanApplications.ApplicationDate between 'date.text' and '" + dojto.Text + "'
Don't do like this, instead go for parameterized query something like below...
Select PFloanApplications.*,convert(varchar(20),PFloanApplications.applicationdate,111)as NewLoanApplicationDate,HREmployeeInfo.EmployeeId,HREmployeeInfo.Title,HREmployeeInfo.FirstName,HREmployeeInfo.MiddleName,HREmployeeInfo.Lastname,HREmployeeInfo.EPFNumber, HREmployeeInfo.FirstName+' '+HREmployeeInfo.Middlename+' '+HREmployeeInfo.lastname As EmployeeName,PFLoanPurpose.LoanPurposeName from PFLoanApplications left outer join HREmployeeInfo on PFLoanApplications.EmployeeId=HREmployeeInfo.EmployeeId left outer join PFLoanPurpose on PFLoanApplications.LoanPurposeId=PFLoanPurpose.LoanPurposeId where (PFLoanApplications.ApplicationDate BETWEEN @StartDate AND @EndDate)and(PFLoanApplications.IsDeleted IS NULL)and(PFLoanApplications.ApprovedStatus is null)
DateTime startDate = DateTime.Parse(date.Text);
DateTime endDate = DateTime.Parse(dojto.Text);
yourCommand.Parameters.AddWithValue("@StartDate", startDate);
yourCommand.Parameters.AddWithValue("@EndDate", endDate);