Register  |  Login



Question

Status: Closed Points: 75 Time: 05:12 - Dec 08, 2006  

theDude

How do I use LIKE with a named parameter in the NHibernate query language?

I need to make a query like the following:

from Product WHERE field1 LIKE 'bla%'

but the "bla" is a parameter that I would like to add as a named parameter.
So it tried:
from Product WHERE field1 LIKE :field1 + '%'
But that doesn't give me any results.

Anyone knows how to do this?

Categories:

Answer Discussion
Answer Summaries

 

Q&A System for Websites and Corporate Collaboration

Advertisement

  • Generates significant organic traffic for websites
  • Saves companies money, resources, and time

Sergio Costa

Date:: Jan 05, 2007

Time:: 11:02

"select * from Product WHERE field1 LIKE @p1; @p1='blah%' "

theDude

Date:: Jan 06, 2007

Time:: 09:25

great, exactly what I was looking for.
I'll try it out and you'll get the points afterwards.

theDude

Date:: Jan 27, 2007

Time:: 07:31

hmmm, i have tried it now, but it doesn't work.
are you sure that your example is for the NHibernate query language? I'm not looking for an SQL way of doing it...

theDude

Date:: Jun 04, 2007

Time:: 01:46

didn't find the solution for this, but gotta close the question...

Question Answered

This question has been closed, and points have been rewarded to the following experts:

theDude: 75

You're welcome however to comment or give additional information or if you wish, you have the ability to write an Answer Summary for the Summary Area.

Answer this Question

New User

Email:

Upon submission of this form, you will automatically be registered as a Quomon user and we will send your login information to this address

Registered User

Username:

Password:

Forgot Your Password?

No summaries have been submitted yet. Want to be the first?

Answer this Question

New User

Email:

Upon submission of this form, you will automatically be registered as a Quomon user and we will send your login information to this address

Registered User

Username:

Password:

Forgot Your Password?

Ask a Question

Have a new question? Ask!

You have 100 characters to use



Top NHibernate Experts

View More

Rank

Expert

Points

1.

nidhi

55

2.

Sergio Costa

25

Become an Expert

Register today to share your knowledge with the community and be recognized and rewarded for your contributions.


Register Here




"Psst, Quomon is a great site. Pass it on."     Tell a Friend  |   Link To Us  |   Save to Delicious  |   Digg! Digg it



Language Options

English:

www.quomon.com

Español:

www.quomon.es