I'm getting a strange error when I attempt to fill a business object from a DB2 database. I know I must be missing something simple (having just now figured out what I was doing wrong with not being able to even try filling a business object), but I'm just not seeing what the problem is.
First, here's the stack trace:
IBM.Data.DB2.DB2ConnPool.a(String A_0, a& A_1, c& A_2) +11132
IBM.Data.DB2.DB2Connection.set_ConnectionString(String value) +353
MicroFour.StrataFrame.Data.Db2.Db2DataSourceItem.CreateBlankDbConnection() +62
MicroFour.StrataFrame.Data.DbDataSourceItem.GetDataTable(DbCommand Command, OnChangeEventHandler CallBack) +73
MicroFour.StrataFrame.Data.DbDataSourceItem.GetDataTable(QueryInformation QueryInfo, OnChangeEventHandler CallBack) +56
MicroFour.StrataFrame.Data.DataLayer.GetDataTable(QueryInformation QueryInfo, Boolean RegisterNotification) +154
MicroFour.StrataFrame.Business.BusinessLayer.FillDataTable(QueryInformation QueryInfo) +54
Payless.Sourcing.MaterialsManagement.SuppliersListing.Page_Load(Object sender, EventArgs e) in I:\PSS Design\Visual Studio\Materials Management\MM_UI\Suppliers\listing.aspx.cs:54
System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e) +15
System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +34
System.Web.UI.Control.OnLoad(EventArgs e) +99
System.Web.UI.Control.LoadRecursive() +47
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1061
What I'm doing is creating a connection which is added to the DataLayer (i.e. mySqlh). I then build a QueryInformation object to get that would fill the business object (i.e. qBizQuery), set the business object's DataSourceKey to the same as the DataSourceKey I just created (from a Web.Config file) and then attempt to fill the business object.
DataLayer.DataSources.Add(new Db2DataSourceItem(Global.Config['DataSourceKey"], connectionString, IBM.Data.DB2.DB2Factory.Instance);
mySqlh = DataLayer.DataSources[Global.Config['DataSourceKey']];
qBizQuery = new QueryInformation();
BizObject.DataSourceKey = Global.Config["DataSourceKey"];
BizObject.FillDataTable(qBizQuery);
The mySqlh object is actually used further down in my code to build a dataset for a gridview control.
So, finally to my question: am I attempting to implement the business objects correctly? Am I missing something else that is causing this invalid argument?
Thanks!