1

I have problems with russian language in my database. I read data from xlsx file. For reading I use library OfficeOpenXml. While debugging there is no problems with encoding, but after adding to database there are only ???. And here is what I've got:

only "???"

4
  • If its colation you can check that on your SQL side by running this query then you need to update it if it is not what you need: SELECT collation_name FROM sys.databases WHERE name = 'database name'; Here is more info: learn.microsoft.com/en-us/sql/relational-databases/collations/… Commented May 18, 2018 at 19:19
  • @Brad nothing changed Commented May 18, 2018 at 19:36
  • Are your character columns set to unicode (ex: nvarchar(max))? Commented May 18, 2018 at 19:39
  • You need to read about, understand and start using parameterized queries. Your code is wide open to sql injection. You should NEVER EVER EVER build up a string like this and execute it. My friend bobby tables love this kind of code. bobby-tables.com Commented May 18, 2018 at 19:41

2 Answers 2

1

ensure your datatypes on the string fields are the "n" versions for strings. nChar, nvarchar, nText so that you will not loose data when dealing with nonANSI charsets

https://learn.microsoft.com/en-us/sql/t-sql/data-types/nchar-and-nvarchar-transact-sql?view=sql-server-2017

Sign up to request clarification or add additional context in comments.

Comments

1

Solved by changing database collation on Cyrillic_General_CI_AS

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.