"Invalid operation. The connection is closed." when setting the connectionstring property
Posted: Tue 17 Jun 2008 11:27
Version: VS 2005 - MyDirect.net 3.50
After upgrading a class library project from VS.NET (and MyDirect.Net for VS.NET) to VS2005 (with MyDirect.net for VS 2005) i start getting a strange error when in initialize my data Class:
private void InitializeComponent()
{
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(DataSted));
this.connMySQLdb4 = new CoreLab.MySql.MySqlConnection();
this.daStedGen = new CoreLab.MySql.MySqlDataAdapter();
this.mySqlSelectCommand1 = new CoreLab.MySql.MySqlCommand();
Then on this, the whole thing crashes:
this.connMySQLdb4.ConnectionString = "User=******;Password=******;Host=my.*****.**;Pooling=True;Connection Lifetime" +
"=60;Min Pool Size=0;Max Pool Size=100;Database=db4;";
Stack trace as such:
[InvalidOperationException: Invalid operation. The connection is closed.]
CoreLab.Common.DbConnectionClosed.ChangeDatabase(String database) +54
CoreLab.Common.DbConnectionBase.ChangeDatabase(String value) +16
For some reason it seems to try to change the database when setting the connection string - this even applies if i drop the database setting from the connection.
After upgrading a class library project from VS.NET (and MyDirect.Net for VS.NET) to VS2005 (with MyDirect.net for VS 2005) i start getting a strange error when in initialize my data Class:
private void InitializeComponent()
{
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(DataSted));
this.connMySQLdb4 = new CoreLab.MySql.MySqlConnection();
this.daStedGen = new CoreLab.MySql.MySqlDataAdapter();
this.mySqlSelectCommand1 = new CoreLab.MySql.MySqlCommand();
Then on this, the whole thing crashes:
this.connMySQLdb4.ConnectionString = "User=******;Password=******;Host=my.*****.**;Pooling=True;Connection Lifetime" +
"=60;Min Pool Size=0;Max Pool Size=100;Database=db4;";
Stack trace as such:
[InvalidOperationException: Invalid operation. The connection is closed.]
CoreLab.Common.DbConnectionClosed.ChangeDatabase(String database) +54
CoreLab.Common.DbConnectionBase.ChangeDatabase(String value) +16
For some reason it seems to try to change the database when setting the connection string - this even applies if i drop the database setting from the connection.