C#: DbType.String versus DbType.AnsiString

前端 未结 4 1445
时光说笑
时光说笑 2021-02-04 00:32

I have taken over some C# code.

The code is hitting a database with some SQL which uses parameters.

All of the string parameters are typed as

4条回答
  •  死守一世寂寞
    2021-02-04 01:10

    See how to solve the problem in C# with Dapper:

    SqlMapper.AddTypeMap(typeof(string), DbType.AnsiString);
    SqlMapper.AddTypeMap(typeof(String), DbType.AnsiString);
    

提交回复
热议问题