I have a datatable with Locale nb-NO and TextInfo ANSICodePage 1252. I run the following code:
IEnumerable<DataRow> ieDatarow = (from row in dtDatatable.AsEnumerable()
where row.ItemArray[row.Table.Columns.IndexOf(strColumn)].ToString() == strValue && row.ItemArray[2].ToString() != "strServiceAccount"
select row).OrderByDescending(x => x.ItemArray[0]).Distinct();
Looking at the data in ieDatarow, strings with characters like æ, ø and å become like this: "ø"
With this code the characters do not change:
IEnumerable<DataRow> ieDatarow = ArgDatatable.AsEnumerable().OrderByDescending(x => x.ItemArray[0]).Distinct()
How can I retain the encoding from the datatable?