0

I am looking at code written by someone else.

Everywhere it uses DbType.AnsiString instead of DbType.String. Why?

CJ7
  • 22,579
  • 65
  • 193
  • 321
  • 1
    Probably because the database was created 20 years ago, before Unicode. Surely somebody in the company you work for knows the real answer. Well, number of years. – Hans Passant Aug 19 '12 at 00:18

1 Answers1

0

DbType.AnsiString is a legacy data type. It handles 8-bit characters rather than Unicode characters.

At the risk of being snarky, your question is kind of like asking "why were the spark plugs in my 1996-model car designed with 1994 design standards?"

Like somebody said, you may need to look through the database schemas and existing code base, or ask somebody, to figure this out.

Maintaining old code and data is a vital part, and the hardest part, of the software developer's profession.

O. Jones
  • 103,626
  • 17
  • 118
  • 172