.net - ODBC Support for Informix Serial and BigInt Data Types -


i have informix dynamic server 11.50 , informix client sdk 3.5 installed on server. developing .net application read data informix database using odbc functions.

in database, have table columns of serial , bigint data types defined. data retrieve function looks this.

    dim cmd new odbc.odbccommand     dim da new odbc.odbcdataadapter     dim ds new dataset     dim sb new stringbuilder("")      try         using cn new odbc.odbcconnection(configurationsettings.appsettings("connstring"))             cn.open()              sb.append("select * interfacesp ")             sb.append("join interface on interfacesp.interfaceid = interface.interfaceid ")             sb.append("left join interfacespaction on interfacesp.interfacespid = interfacespaction.interfacespid , action_status = 'actv' ")             sb.append(" interfacesp.interfaceid = ? ")             sb.append(" order interfacesp.spname")              cmd.connection = cn             cmd.commandtype = commandtype.text             cmd.commandtext = sb.tostring             cmd.parameters.addwithvalue("@interfaceid", strinterfaceid)              da.selectcommand = cmd             da.fill(ds, "interfacesplist")          end using          return ds      catch ex exception         throw ex     end try 

the end result dataset passed datagrid object. problem .net throws exception whenever datagrid loaded.

unknown sql type - -114. [argumentexception: unknown sql type - -114.] 

i've tried modify columns serial , bigint data types integer. and, works fine without modifying single line of code.

i need advice how overcome problem need serial data type column incrementing id column. bigint data type column, may can change column integer data type instead.

any advice welcome.

.net "knows" finite set of data types. .net data providers retrieve data various data sources must convert various data types .net recognizes. odbc .net data provider has number of recognized types built it. outside set can result in error.

to around this, suspect can cast data type in sql select statement run. not familiar informix, brief bit of googling seems indicate cast done format columnname::newtype. need replace * in select statement specific fields , cast problematic columns recognized type such integer: serialcol::integer. (i'm guessing @ type).


Comments

Popular posts from this blog

c++ - Convert big endian to little endian when reading from a binary file -

C#: Application without a window or taskbar item (background app) that can still use Console.WriteLine() -

unicode - Are email addresses allowed to contain non-alphanumeric characters? -