Keyword not supported: 'metadata'.

Keyword not supported: 'metadata'.

Postby WigWugTWW » Wed 11 Sep 2013 13:22

I am using database first and reading in the configuration string from app.config. When I attempt to use MySqlConnectionStringBuilder to construct a object I get the error, "Keyword not supported: 'metadata'." Below is a copy of the code. Please advise. (error is in the constructor with the connectString parameter.

ConnectionStringSettings settings = ConfigurationManager.ConnectionStrings["uwcconceptEntities"];
if (null != settings)
{
string connectString = settings.ConnectionString;
MySqlConnectionStringBuilder builder = new MySqlConnectionStringBuilder(connectString);
builder.Host = "PIE-PC";
builder.Database = "karldbf";

}
WigWugTWW
 
Posts: 2
Joined: Wed 25 Apr 2012 13:54

Re: Keyword not supported: 'metadata'.

Postby Pinturiccio » Thu 12 Sep 2013 15:01

WigWugTWW wrote:When I attempt to use MySqlConnectionStringBuilder to construct a object I get the error, "Keyword not supported: 'metadata'."

This error occurs when you pass a connection string with the metadata parameter to the MySqlConnectionStringBuilder constructor. The metadata parameter is not supported in both MySqlConnectionStringBuilder and MySqlConnection. To solve the issue delete the 'metadata=<METADATA>' record from the connection string in your app.config file.
Pinturiccio
Devart Team
 
Posts: 1860
Joined: Wed 02 Nov 2011 09:44

Re: Keyword not supported: 'metadata'.

Postby MariiaI » Mon 16 Sep 2013 10:03

The recommendation above was for the using our provider without Entity Framework.
In case you are working with Entity Framework, please try the following code and tell us if this helps:
Code: Select all
ConnectionStringSettings settings =  ConfigurationManager.ConnectionStrings["TestMEntitiesConnectionString"];
            string connectString = settings.ConnectionString;

            EntityConnectionStringBuilder entityConnectionStringBuilder = new EntityConnectionStringBuilder(connectString);

            MySqlConnectionStringBuilder mySqlConnectionStringBuilder = new MySqlConnectionStringBuilder(entityConnectionStringBuilder.ProviderConnectionString);
            mySqlConnectionStringBuilder.Database = "database";
            mySqlConnectionStringBuilder.Host = "host";
            entityConnectionStringBuilder.ProviderConnectionString = mySqlConnectionStringBuilder.ToString();

            var efConnectionString = entityConnectionStringBuilder.ToString();

            TestMEntities context = new TestMEntities(efConnectionString);
            ....
MariiaI
Devart Team
 
Posts: 1472
Joined: Mon 13 Feb 2012 08:17


Return to dotConnect for MySQL