I am inserting some unicode characters such as Chinese characters using a c# program into a SQL Server 2012 database.
The column I am trying to insert is nvarchar
, but am still getting ??????? instead of the correct characters. I am getting tweets from twitter and inserting it into a database.
I am using SQL Server 2012 Express. Must I install any language packages or change the settings? I am not really familiar with SQL Server.
This is how i use c# to insert the codes into database:
String command4 = "INSERT INTO tweets ([username], [createdDate], [tweet]) Values ('" + item.user.screen_name + "' , '" + item.created_at + "' ,N'" + escapedString + "')";
SqlCommand insertTweet = new SqlCommand(command4, connectionstring);
insertTweet.ExecuteNonQuery();
Thank you!
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…