I am using NHibernate and it is working perfectly except for adding strings to the database
when I try to add string using this way
string charname = "Dan";
var account = new Account
{
Username = charname
};
AccountRepository.Add(account);
it works but when I try to add the string that is read from a stream
string charname = reader.ReadString(false, length + 1);
var account = new Account
{
Username = charname
};
AccountRepository.Add(account);
it adds nothing to the table. Can anyone explain why this is happening?
(Even though when printing the value charname it is printed correctly)
Might be a character appended to the value you want to add that the database is not accepting double check the value you are adding using debugging mode to check what is the actual value is before added to the databse.