1) Don't use string concatenation to build the statement.
2) As I see, you have tried to make use of parameters, but you mixed it somehow.
This is a good tutorial:
Gotcha #1161: Using Named Parameters with Oracle ODP.NET[
^]
According to it, your query string should look like this:
Dim queryString As String = "select * from abc where tran_dttm <= :bdp1 and tran_dttm > :bdp1 and lpt = :lpt and device = :device"
And you should add the other two parameters as you did with
bdp1
.
But as I see this won't return anything, because
(tran_dttm<=bdp1 and tran_dttm>bdp1)
will never be true.