Strings are appended with special characters when returning from the database

I am using NHibernate to query an Oracle 8i database. The problem is that all strings in the returned objects are concatenated with special characters. For example,

CUSTOMER,ONE       

      

The nhibernate field type is AnsiString and the Oracle data type is CHAR (20) and the character set is CHAR_CS. I am completely new to Oracle so I have no idea what is going on :(

+2


source to share


2 answers


CHAR (20) means that the field is filled as needed, no more than 20 characters long. The fill symbol is empty.

There must be a problem in the character set settings if whitespace appears as question marks. You can find more details on your problem here .



This is where you need to truncate the returned strings, or better yet go to VARCHAR2 (20).

+4


source


I couldn't find a suitable solution for this problem, but changing the nhibernate driver from OracleClientDriver to "OleDbDriver" solved the problem. That said, if anyone knows how to properly fix this issue, please let me know as I don't like using OldDbDriver to access Oracle due to possible compatibility issues.



0


source







All Articles