These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 
Author Message
 Post subject: Nhibernate Unicode String Compare Using N'' Method
PostPosted: Thu Apr 10, 2008 9:50 am 
Newbie

Joined: Sun May 14, 2006 8:48 am
Posts: 12
Hibernate version:1.2.0
database : SQLServer 2005

U want to compare an unicode string in sql server. in plain sql we need to prefix string with N character meaning string is unicode. for example:

Code:
SELECT * FROM Table1 WHERE Co1 = N'Unicode String containing characters other than ascii'


But in hibernate, we can not do that because an error will occure. see http://forum.hibernate.org/viewtopic.php?t=983333

does nhibernate has a way to solve this problem?


Top
 Profile  
 
 Post subject:
PostPosted: Thu Apr 10, 2008 2:45 pm 
Expert
Expert

Joined: Fri Oct 28, 2005 5:38 pm
Posts: 390
Location: Cedarburg, WI
Use a query parameter rather than a literal string.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.