Keyword not supported in MySQL's connection string

浪子不回头ぞ 提交于 2019-12-12 02:37:35

问题


To get the connection string from my App.config I write this code:

ConnectionStringSettings settings
    = ConfigurationManager.ConnectionStrings["livresEntities"];

string connectString = settings.ConnectionString;

Console.WriteLine("Original: "+ connectString);

The result (I use Data Model .edmx file):

Original: metadata=res://*/Model1.csdl|res://*/Model1.ssdl|res://*/Model1.msl;provider=MySql.Data.MySqlClient;provider connection string="server=localhost;user id=root;persistsecurityinfo=True;database=livres"

But when I want to change the password or the uid using this line:

MySqlConnectionStringBuilder builder
    = new MySqlConnectionStringBuilder(connectString);<br>

It give me the following error:

Keyword not supported

Why? If there is any tutorial on how to secure MySQL's connection string using a Model (.edmx) it will be very helpful for me.

来源:https://stackoverflow.com/questions/24333098/keyword-not-supported-in-mysqls-connection-string

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!