tags:

views:

15

answers:

0

Our customer is using a driver by iWay Software to provide ODBC access to sequential files on a mainframe system. They are able to access the data successfully from Excel using the ODBC source but when we try to access the schema information using GetSchemaTable() on a successfully opened DbDataReader the following exception is thrown:

System.ArgumentException: Unknown SQL type - 0. at System.Data.Odbc.TypeMap.FromSqlType(SQL_TYPE sqltype) at System.Data.Odbc.OdbcDataReader.BuildMetaDataInfo() at System.Data.Odbc.OdbcDataReader.GetSchemaTable() at System.Data.Odbc.OdbcMetaDataFactory.DataTableFromDataReaderDataTypes(DataTable dataTypesTable, OdbcDataReader dataReader, OdbcConnection connection) at System.Data.Odbc.OdbcMetaDataFactory.GetDataTypesCollection(String[] restrictions, OdbcConnection connection) at System.Data.Odbc.OdbcMetaDataFactory.PrepareCollection(String collectionName, String[] restrictions, DbConnectionconnection) at System.Data.ProviderBase.DbMetaDataFactory.GetSchema(DbConnection connection, String collectionName, String[] restrictions) at System.Data.ProviderBase.DbConnectionInternal.GetSchema(DbConnectionFactory factory, DbConnectionPoolGroup poolGroup, DbConnection outerConnection, String collectionName, String[] restrictions) at System.Data.Odbc.OdbcConnection.GetSchema(String collectionName, String[] restrictionValues) at System.Data.Odbc.OdbcConnection.GetSchema(String collectionName) at MyApplication.ReadAdo.GetRowDefinition()

From the looks of things a System.ArgumentException is being thrown in System.Data.Odbc.TypeMap.FromSqlType() due to an unknown SQL type of 0.

Is there any way that we can ignore this error as we don't really require the data types for the columns, just the list of columns names? Alternatively, is there any other way that we can access this schema information?