0

How do I change encoding of my database ? Project is NET.CORE 2.1

I tried :

ALTER DATABASE DBNAME CHARACTER SET utf8 COLLATE utf8_general_ci;

But VisualStudio did not accept that command, due to syntax Error

The second thing I tried was to change appsetting.json by adding Charset=utf8 to ConnectionString.

That did not work either. VisualStudio could not work out Charset keyword.

Are there any other ways to do that ? Or is there any mistake in my command ?

Command : enter image description here

John Ronald
  • 135
  • 8
  • Show us please the asp code and the complete error message – nbk Nov 05 '19 at 18:19
  • Changing the default charset for the database does very little. If you are having trouble with garbled characters, see https://stackoverflow.com/questions/38363566/trouble-with-utf8-characters-what-i-see-is-not-what-i-stored – Rick James Nov 05 '19 at 23:05
  • Eventually, I solved it by adding "N" in fron of text string whithing my sql command. – John Ronald Nov 06 '19 at 10:09

0 Answers0