Is it possible to establish connection mapping in the MySql connection string and how, since the server uses the default setting for new connections.
Two things I can not do :
I can’t call SET COLLATION_CONNECTIONafter I open the connection, because I use the Entity Framework, which makes all the calls to me not quite true, as you can see in edit- It is not possible to change the default server connection setting due to other databases and their respected applications that use them.
All I would like to specify is a specific connection string parameter in my web.config file, for example:
"User id=dbuser;Password=dbpass;Host=dbserver;Database=testung;Collation=utf8_general_ci"
but Collationsetting / variable is not recognized.
Used technologies
- Asp.net MVC 2
- IIS 7
- Entity Framework 1
- MyArt dotConnect MySql Connector
- MySql 5.1
EDIT 1
I tried this code as @Devart suggested , but to no avail :
partial void OnContextCreated()
{
System.Data.Common.DbCommand command = this.Connection.CreateCommand();
command.CommandText = "set collation_connection = utf8_slovenian_ci;";
command.CommandType = System.Data.CommandType.Text;
this.Connection.Open();
command.ExecuteNonQuery();
}
source
share