querybuilder
querybuilder copied to clipboard
SqlKata.Execution problem on nvarchar or unicode characters on update and insert
Hi, I used this code to update a Unicode (nvarchar) field in the database. but instead of Unicode characters, it saves the question mark (like this: ????? ????) into the database.
public void updateUser(int userId,string unicodeName){ var q = DbQueryFactory.Query("Users").Where("Id", userId) .AsUpdate(new { Fullname = unicodeName, LastModifiedBy = userId, LastUpdate = DateTime.Now, });
var compiler = new SqlServerCompiler();
string queryStr = compiler.Compile(q).ToString();
return DbQueryFactory.Statement(queryStr);
}