Database connection string and collation

前端 未结 2 434
心在旅途
心在旅途 2021-01-15 15:45

Is it possible to set connection collation within MySql connection string and how, since there\'s a default setting on the server that\'s used for new connections.

T

2条回答
  •  长情又很酷
    2021-01-15 16:27

    If anyone else stumbles over this problem or wants to issue a command when opening a connection: The answer regarding OnContextCreated does no longer work as the method does no longer exist/is no longer supported.

    An alternative, which I use for executing SET NAMES is to append ;initialization command=\"SET NAMES '" + CharSet + "';\" to your connection string. According to Devart's documentation this also works for PostgreSQL, MSSQL and Oracle

    This property can also be set inside EntityDeveloper when accessing the properties of the database connection and clicking on the Advanced button.

提交回复
热议问题