Cannot find component by name (some name) in global components cache
Posted: Wed 21 May 2008 07:50
Hello, i've been working with PosgreSQLDirect for a short time, so it may be my mistake, but...
The poin is that i'm trying to get data from a DB. I created a custom user controll and tried to add a data set to it using PostgrSQLDirect DataSet Wizard. The wizard generated for me the conection, dataAdapter and a sqlCommand. Then I added the controll to a Form tried to run it. I got this exception:
Exception has been thrown by the target of an invocation
InnerException in it was:
Cannot find component by name WarehouseList.pgSqlCommand17 in global components cache
With debbuger i found out, that this exception is thowed by this line:
//
// pgSqlDataAdapter1
//
this.pgSqlDataAdapter1.TableMappings.AddRange(new System.Data.Common.DataTableMapping[] {
new System.Data.Common.DataTableMapping("Table", "wrh_select_warehouse", new System.Data.Common.DataColumnMapping[] {
new System.Data.Common.DataColumnMapping("code", "code"),
new System.Data.Common.DataColumnMapping("name", "name"),
new System.Data.Common.DataColumnMapping("country_name", "country_name"),
new System.Data.Common.DataColumnMapping("city_name", "city_name")})});
this.pgSqlDataAdapter1.SelectCommand = ((CoreLab.PostgreSql.PgSqlCommand)(CoreLab.Common.GlobalComponentsCache.GetObjectByName("WarehouseList.pgSqlCommand17")));
Am I doing something wrong?
P.S. I'm using PostgeSQL 8 and .NET 3.5 with MS VS 08
The poin is that i'm trying to get data from a DB. I created a custom user controll and tried to add a data set to it using PostgrSQLDirect DataSet Wizard. The wizard generated for me the conection, dataAdapter and a sqlCommand. Then I added the controll to a Form tried to run it. I got this exception:
Exception has been thrown by the target of an invocation
InnerException in it was:
Cannot find component by name WarehouseList.pgSqlCommand17 in global components cache
With debbuger i found out, that this exception is thowed by this line:
//
// pgSqlDataAdapter1
//
this.pgSqlDataAdapter1.TableMappings.AddRange(new System.Data.Common.DataTableMapping[] {
new System.Data.Common.DataTableMapping("Table", "wrh_select_warehouse", new System.Data.Common.DataColumnMapping[] {
new System.Data.Common.DataColumnMapping("code", "code"),
new System.Data.Common.DataColumnMapping("name", "name"),
new System.Data.Common.DataColumnMapping("country_name", "country_name"),
new System.Data.Common.DataColumnMapping("city_name", "city_name")})});
this.pgSqlDataAdapter1.SelectCommand = ((CoreLab.PostgreSql.PgSqlCommand)(CoreLab.Common.GlobalComponentsCache.GetObjectByName("WarehouseList.pgSqlCommand17")));
Am I doing something wrong?
P.S. I'm using PostgeSQL 8 and .NET 3.5 with MS VS 08