tags:

views:

30

answers:

1

Hi All, In my config i have this: 'English (United States)' 1, 'Español (España)' 2

I'm executing a stored procedure that expect an int. I'm getting the exception: '...cannot convert nvarchar to int...' . Tha is because the substitution is not working. I never get 'English (United States)'replaced with 1

I'm doing parameter binding this way:

... string culture = "English (United States)"; IQuery query = NHibernateSession.GetNamedQuery(namedQuery) .SetString("IdiomId", culture) ...

Thnks and hope you can help me

A: 

I think that you might have forgotton the equals

'English (United States)' 1, 'Español (España)' 2

Try Instead 'English (United States)'= 1, 'Español (España)'= 2

alternativly try looking at this question how-to-persist-an-enum-using-nhibernate

Nathan Fisher