Pakeeza

Pakeeza

  • 1.6k
  • 107
  • 4.8k

Getting data from view from oracle to c#

Jan 30 2024 1:03 PM

I have a view in oracle having following fields from a table CustomerOrders 

STUDENT_NO          NOT NULL NUMBER(13)  
STUDENT_ACCOUNT_TYPE NOT NULL NUMBER(3)   
_STUDENT_ACTIVITY_TYPE       NOT NULL NUMBER(3)   
STUDENT_CREDEIT_CARD_NUMBER                  NUMBER      
STUDENT_TRANSACTION_ NOT NULL NUMBER(3)   
   

I have placed this view as model in entityDatamodel edmx and when i am trying to access it 

var v=(from tt in db.myview where tt.STUDENT_NO ==studentID select tt).firstOrDefault();
in above code studentID is parameter which works fine but when I tried to add the rest of the columns I am getting an error 
"VALUE WAS EITHER TOO LARGE OR TOO SMALL FOR AN UNSIGNED BYTE" 
remember m parameter studentId i first convert this into long like 

long studentID=

studentID=long.Parse(studentID{this is parameter);

Why when i add more columns then it shows the above error If I chose only first column it did not gives any error 


Answers (4)