I have a linq table "KUND" that is read only to me. It has special characters in which I have a function to switch them to the ones I want.
public static string changeSpecialCharacters(string kund)
{
StringBuilder b = new StringBuilder(kund);
b = b.Replace("Õ", "å");
b = b.Replace("┼", "Å");
b = b.Replace("õ", "ä");
b = b.Replace("─", "Ä");
b = b.Replace("÷", "ö");
b = b.Replace("Í", "Ö");
b = b.Replace("'", " ");
b = b.Replace("¦", "´");
b = b.Replace("Ï", "Ø");
return b.ToString();
}
Now I have two questions:
1 Can I add this function to GET in an autogenerated datacontext, so I don’t need to call it all over my code? I added it, but it seems to be deleted whenever I modify my datacontext file (add / delete table). 2 Any suggestions on how to make this feature better in terms of speed, perhaps?
source
share