Adding an Oracle table with column type of VARCHAR2 creates a System.Object type in the context

Discussion of open issues, suggestions and bugs regarding LinqConnect – Devart's LINQ to SQL compatible ORM
Post Reply
neiltrodden
Posts: 10
Joined: Tue 05 Mar 2013 16:12

Adding an Oracle table with column type of VARCHAR2 creates a System.Object type in the context

Post by neiltrodden » Fri 12 Apr 2013 07:50

So in Visual Studio, if I update my model from the Oracle database, table columns that are the type of varchar2 are mapped to System.Object types in the table models which causes errors with Linq queries. If I go into the .lqml file and edit as xml, I can replace System.Object with System.String and everything works fine.

Can you suggest how I can make this mapping happen automatically, or perhaps suggest what I may be doing wrong to get this type of behaviour? Thanks!

MariiaI
Devart Team
Posts: 1472
Joined: Mon 13 Feb 2012 08:17

Re: Adding an Oracle table with column type of VARCHAR2 creates a System.Object type in the context

Post by MariiaI » Mon 15 Apr 2013 12:02

Thank you for the report. We will inform you when the new build of LinqConnect with the fix is available for download.
As a workaround, you could try doing the following:
- open Tools -> Entity Developer -> Options -> Server Options -> Oracle;
- press the "Add" button for adding a new type mapping rule;
- set the .NET type to 'String' and Server Type to 'VARCHAR2';
- press 'OK' to save the changes.

Re-create your model in order for changes to become effective for all entity classes( use "Update Model from Database" wizard with the selected "Recreate Model" check box).

neiltrodden
Posts: 10
Joined: Tue 05 Mar 2013 16:12

Re: Adding an Oracle table with column type of VARCHAR2 creates a System.Object type in the context

Post by neiltrodden » Mon 15 Apr 2013 15:13

Thanks for your help, I didn't realise this option was available for me to create my own mappings!

MariiaI
Devart Team
Posts: 1472
Joined: Mon 13 Feb 2012 08:17

Re: Adding an Oracle table with column type of VARCHAR2 creates a System.Object type in the context

Post by MariiaI » Fri 19 Apr 2013 06:50

The new build of LinqConnect 4.2.229 is available for download now. It can be downloaded from http://www.devart.com/linqconnect/download.html (trial version) or from Registered Users' Area (for users with valid subscription only).
For more information please refer to http://forums.devart.com/viewtopic.php?f=31&t=26911


Post Reply