ADO.Net provides all row types from the SQL Server provider as C # strings, which means that they have already been converted to Unicode. For source columns other than unicode (like yours, obviously), like char(n) or varchar(n) , the ADO.Net SQL Server provider uses the source mapping to determine the encoding. Therefore, if your SQL Server data other than unicode is presented in .Net with the wrong encoding, it must be presented to the provider with the wrong sort. Select the appropriate collation for your data, and the ADO.Net provider for SQL Server will translate it using the appropriate encoding. For example, as described in Collation and Code Page Architecture , cyrillic mappings will result in code page 1251 , which is very likely what you want. Related articles contain all the information you need to resolve your issue.
using System; using System.Text; using System.Data.SqlClient; using System.Windows.Forms; public class Hello1 { public static void Main() { try { using (SqlConnection conn = new SqlConnection("server=.;integrated security=true")) { conn.Open ();
Result:
Remus Rusanu
source share