Please assist, I am getting the error An item with the same key has already been added.
By Code is below.
Public Function SearchFilter(strClockNo As String, dtpFromDate As Date, dtpToDate As Date) As DataTable
Dim sSQL As New System.Text.StringBuilder
Try
sSQL.Append(vbCrLf & " SELECT mrID,")
sSQL.Append(vbCrLf & " mr.Code , ")
sSQL.Append(vbCrLf & " FName, ")
sSQL.Append(vbCrLf & " LName, ")
sSQL.Append(vbCrLf & " DateTested, ")
sSQL.Append(vbCrLf & " DateCapt ")
sSQL.Append(vbCrLf & " FROM tblMR,")
sSQL.Append(vbCrLf & " GuHR_Data.dbo.EC")
sSQL.Append(vbCrLf & " WHERE tblMR.EmployeeID = EmployeeCodes.EmployeeID COLLATE Latin1_General_BIN")
sSQL.Append(vbCrLf & " AND EmployeeCodes.TermDate Is Null")
sSQL.Append(vbCrLf & " AND EmpCodes.Company IN (1,3)")
sSQL.Append(vbCrLf & " AND tblMR.Code LIKE @strClockNo")
sSQL.Append(vbCrLf & " AND DateTested Between @dtpFromDate AND @dtpToDate")
sSQL.Append(vbCrLf & " ORDER BY LastName ASC")
Dim sqlParameters As Dictionary(Of String, Object) = New Dictionary(Of String, Object)
sqlParameters.Add("ClockNo", strClockNo.Replace("'", "''"))
sqlParameters.Add("DateTested", SQLDate(dtpFromDate))
sqlParameters.Add("DateTested", SQLDate(dtpToDate))
Return Me.sqlExecutor(sSQL.ToString, sqlParameters, SQLCommunication.returnType.datatable)
Catch ex As Exception
Throw ex
End Try
End Function