Unsigned int mysql in c #

In mysql, I declared fields of type unsigned int. They were INT (10) UNSIGNED by default. In my C # code, when I try to read these values ​​for the uint type, it gives me the error message "cannot convert long to uint". Something is missing here. I thought BIGINT should be long and int (10) unsigned should be uint? I use an entity structure to read in values ​​... Thanks

THE CODE

from employee in model.employees select new EmployeeEntity { EmpID = employee.EmpID, FirstName=employee.FirstName }; 

EmpID declared as UNSIGNED INT 10 in mysql

EmployeeEntity declares EmpID as uint (I also tried uint32). However line

Assigning "EmpID = employee.EmpID" gives me an error ...

+2
c # mysql linq entity-framework
Jan 02 '10 at 14:10
source share
2 answers

This is a problem with the provider. It converts types between the DBMS and the application with errors. I recommend that you seek support or change your provider.

As for me - I am using Devart dotConnect for MySQL. Here is the mapping table - http://www.devart.com/dotconnect/mysql/docs/DataTypeMapping.html

0
Jan 03 2018-11-11T00:
source share

Sounds like a problem with an EF provider. Perhaps the value is simply retrieved as long. But since you know its uint, you can just drop it from long to uint. But try to check if a newer version of the EF provider exists that displays the types correctly.

0
Jan 02 '10 at 14:16
source share



All Articles