I've been creating queries for my program and I ran into an odd error in VB.Net. What happens is, when I run the program and use the query, the program closes and gives me the following error. Cannot perform 'Like' operation on System.DateTime and System.String
. What I want for this query to do is allow the user to search dates.
Lets say I had a record that has the date 5/16/2011. I want to be able to type 5 into the query and see all the records that contain 5/--/---- and so on. I believe this is done by using a textchanged property but alas I have that error.
Here is the code I have been using:
Private Sub txtOrder_TextChanged(sender As System.Object, e As System.EventArgs) Handles txtOrder.TextChanged
If txtOrder.TextLength > 0 Then
All_flood_certsBindingSource.Filter = String.Format("[Order Received] Like '" & txtOrder.Text) & "'"
All_flood_certsBindingSource.Filter = String.Empty
If anyone can shed some light on this issue I would be greatly thankful!