Oracle column: user_id int not null,
Linq query:
UserId = user.Field<int>("user_id"),
UserId is int type. Other string, char fields are workign fine, only when I use thsi field I get this error.
What is the correct mapping or anythign I am doing wrong ?
If you’re using
Field<T>()then that suggests you’re using aDataTable, at which point the database type is mostly irrelevant. The exception should show you how the cast has failed – what the actual type is. If it doesn’t, you can easily put some diagnostics in though:I suspect you’ll find it’s
longorshort, or something like that – but this should show you for sure.