0
In the database the guy is BigInt
and in C# I’m trying to convert to int
and he can convert, but when it comes to instruction lambda, makes a mistake.
long codpro = Int64.Parse(tb_CodigoProduto.Text.Substring(0,14));
db = (from p in data.Produtos where p.ProCodInt == codpro select p).FirstOrDefault();
You are converting to
long
nayint
and this is correct. Without knowing the error that gives gets a little complicated help. When you ask a question with a code that gives an error, you should post that error, where exactly it gives, in what circumstances, all the relevant parts of the code and if possible a code that can reproduce it: http://answall.com/help/mcve– Maniero
"the 'Procodint' Property on 'Products' could not be set to a 'Int64' value.You must this Property to a non-null value of 'Int32'"
– Bruno Rodrigues
What is the type of
ProCodInt
? Would be aint
? Or aint?
?– Maniero
[Procodint] [bigint] NOT NULL
– Bruno Rodrigues
Needs the kind of
p.ProCodInt
, maybe it is good to put the whole structure of the type ofp
.– Maniero
I give up, I hope someone can get the necessary information out of you or I can give you a solution even if you don’t pass on the necessary information.
– Maniero