IBM.Data.DB2.dll on .Net 2.0 Framework

  • Thread starter Thread starter Sushi
  • Start date Start date
S

Sushi

I have a .Net application that references the IBM.Data.DB2.dll. The
version of this dll I have is from UDB 8.1 FixPak3. In my application I
have some code like below:

m_Da = new DB2DataAdapter();
m_Da.SelectCommand = new DB2Command();
m_Da.SelectCommand.Connection = connection;
m_Da.SelectCommand.CommandType = CommandType.Text;
m_Da.SelectCommand.CommandText = "Select * From sourcetb";
m_Da.SelectCommand.UpdatedRowSource = UpdateRowSource.Both;
m_Da.SelectCommand.CommandTimeout = 0;

m_Tb = new DataTable();

m_Da.FillSchema(m_Tb, SchemaType.Mapped);


When I run this application on the .Net 2.0 framework the FillSchema
line throws an exception:

Unable to cast object of type 'IBM.Data.DB2.DB2Command' to type
'System.Data.Com
mon.DbCommand'.
at System.Data.Common.DbDataAdapter.get_SelectCommand()
at System.Data.Common.DbDataAdapter.FillSchema(DataTable dataTable,
SchemaTyp
e schemaType)


Is the IBM .Net data provider suported on the .Net 2.0 framework? Does
a later FixPak fix this issue?

Thanks
Sushmitha
 
Back
Top