StrataFrame Forum

Invalid Business Object Code Generated - DB2 Database

http://forum.strataframe.net/Topic12374.aspx

By Alan W - 11/2/2007

I created a StrataFrame business object using a table in a DB2 database hosted on an IBM mainframe. The StrataFrame code generator created the code immediately below which will not compile and is not correct.  IBM.Data.DB2.DB2Type is a type (enum) and not a value. 

 

            _FieldNativeDbTypes = new Dictionary<string, int>(10);

            _FieldNativeDbTypes.Add("NUM_STR_ID", IBM.Data.DB2.DB2Type);

            _FieldNativeDbTypes.Add("NUM_STR", IBM.Data.DB2.DB2Type);

            _FieldNativeDbTypes.Add("NM_STR", IBM.Data.DB2.DB2Type);

            _FieldNativeDbTypes.Add("NUM_CLU", IBM.Data.DB2.DB2Type);

            _FieldNativeDbTypes.Add("DES_STR", IBM.Data.DB2.DB2Type);

            _FieldNativeDbTypes.Add("NUM_ZN", IBM.Data.DB2.DB2Type);

            _FieldNativeDbTypes.Add("NUM_WH", IBM.Data.DB2.DB2Type);

            _FieldNativeDbTypes.Add("NUM_PPO", IBM.Data.DB2.DB2Type);

            _FieldNativeDbTypes.Add("NUM_ASN", IBM.Data.DB2.DB2Type);

            _FieldNativeDbTypes.Add("IND_STR_STS", IBM.Data.DB2.DB2Type);

 

I made modifications to the code as shown below which allows the code to compile and I believe that I have made the correct selections for the data type enum.

 

            _FieldNativeDbTypes = new Dictionary<string, int>(10);

            _FieldNativeDbTypes.Add("NUM_STR_ID", (int)IBM.Data.DB2.DB2Type.Integer);

            _FieldNativeDbTypes.Add("NUM_STR", (int)IBM.Data.DB2.DB2Type.Integer);

            _FieldNativeDbTypes.Add("NM_STR", (int)IBM.Data.DB2.DB2Type.VarChar);

            _FieldNativeDbTypes.Add("NUM_CLU", (int)IBM.Data.DB2.DB2Type.Integer);

            _FieldNativeDbTypes.Add("DES_STR", (int)IBM.Data.DB2.DB2Type.VarChar);

            _FieldNativeDbTypes.Add("NUM_ZN", (int)IBM.Data.DB2.DB2Type.Integer);

            _FieldNativeDbTypes.Add("NUM_WH", (int)IBM.Data.DB2.DB2Type.Integer);

            _FieldNativeDbTypes.Add("NUM_PPO", (int)IBM.Data.DB2.DB2Type.Integer);

            _FieldNativeDbTypes.Add("NUM_ASN", (int)IBM.Data.DB2.DB2Type.Integer);

            _FieldNativeDbTypes.Add("IND_STR_STS", (int)IBM.Data.DB2.DB2Type.Integer);

 

By StrataFrame Team - 11/5/2007

I believe there was an issue with the _NativeDbType variable being used within our code, rather than the NativeDbType property (one returns a System.Type, while the other stores the enum), however, the issue should be resolved in the latest version of the DLLs.  Try getting the latest version from the Posted Releases forum and let me know if it fixes the problem (you should only need the AddIns DLL).

If it doesn't fix it, then let me know and I'll post it again.

By StrataFrame Team - 11/5/2007

Here's the link to save you some searching:

http://forum.strataframe.net/FindPost12266.aspx