This question is locked. New answers and comments are not allowed.
If you have a string like "A-B" in a varchar(MAX) field and you search for "A_B" DataAccess will return "A-B" from the database.
To reproduce I created a table called Tests with a varchar(MAX) field called Str.
I added 2 test records. "A" and "A-B"
I created a new Entities Model with the Tests Table and ran the following code.
Dim SearchStr As String = "A_B"
Dim EM As New EntitiesModel
Dim Obj As Test = (From e In EM.Tests Where e.Str = SearchStr Select e).FirstOrDefault
Obj.Str returns "A-B" from the Tests Table
If you set SearchStr to "_" it will return "A" from the Tests Table
To reproduce I created a table called Tests with a varchar(MAX) field called Str.
I added 2 test records. "A" and "A-B"
I created a new Entities Model with the Tests Table and ran the following code.
Dim SearchStr As String = "A_B"
Dim EM As New EntitiesModel
Dim Obj As Test = (From e In EM.Tests Where e.Str = SearchStr Select e).FirstOrDefault
Obj.Str returns "A-B" from the Tests Table
If you set SearchStr to "_" it will return "A" from the Tests Table