Hi,
I need to create a query with like expression on a string column.
This query need to run on Access, MySQL, SQL Server, Oracle.
Actually, my code is:
Code:
result = session.CreateQuery("select count(*) from PatientsEntity where enabled <> 0 and DisplayName like :DisplayName")
.SetString("DisplayName", "\"" + expression + "*\"")
.UniqueResult<System.Int64>();
Example: in my code, "\"" + expression + "*\"" return "JE*"
When I run my code, I get:
Code:
could not execute query
[ select count(*) as x0_0_ from Patients patientsen0_ where (enabled<>0 )and(DisplayName like ? ) ]
Name: DisplayName - Value: "*"
[SQL: select count(*) as x0_0_ from Patients patientsen0_ where (enabled<>0 )and(DisplayName like ? )]
What's the real way to initialize the DisplayName parameter please ?
Papy