Quantcast
Channel: Oracle, MySQL, Sybase, Informix and other databases
Viewing all articles
Browse latest Browse all 1350

gridview error : caused by the Mapping between Oracle Data Types to EDM Types

$
0
0

i have oracle DB contain information about devices

in oracle DB i have table contain info about devicess

in this table i have column contain id of the devices

this column type of number(5)

dev_inv_no number(5,0)

when i used EF to create my model

the generated class for the devices

defined the dev_inv_no column to short

publicshortDEV_INV_NO { get;set; }

but when i use linq query and bind the result to gridview then run the web it show me error

Value was either too large or too small for an Int16

 i try to change the device class topublic int DEV_INV_NO {get;set; }

but it show me error

The type 'Edm.Int16' of the member 'DEV_INV_NO' in the conceptual side type 'ContainarModel.OES_DEVICE' does not match with the type 'System.Int32' of the member 'DEV_INV_NO' on the object side type 'TEST.Models.OES_DEVICE'.

also i try to change Edm type to int32 but i give me error because in in oracle DB theDEV_INV_NO column type is number(5,0)

this is my code

using(Entitiesctx = newEntities())

            {

varOraLINQ1 = (fromdevinctx.xxxx

wheredev.DEV_TYPE_CODE == 1                     

orderbydev.DEV_INV_NO

selectnew{

                        DEV_INV_NO = dev.DEV_INV_NO

                        DEV_MODEL_NAME = dev.DEV_MODEL_NAME,

                          DEV_OS = dev.DEV_OS,

                           DEV_CPU = dev.DEV_CPU,

                           DEV_RAM = dev.DEV_RAM,

                           DEV_IP = dev.DEV_IP,

                          DEV_TYPE_CODE,

                           DEV_LOCATION_DESC = dev.DEV_LOCATION_DESC

                                }).ToList();

                GridView1.DataSource = OraLINQ1;

                GridView1.DataBind();}

 

 

 

 

 

 

 

 

 


Viewing all articles
Browse latest Browse all 1350

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>