querybuilder icon indicating copy to clipboard operation
querybuilder copied to clipboard

SqlKata.Execution problem on nvarchar or unicode characters on update and insert

Open mojtaba-yekta opened this issue 2 years ago • 0 comments

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);

}

mojtaba-yekta avatar Mar 08 '22 08:03 mojtaba-yekta