0
I’m having a problem conducting the following search:
var estDel = bdprincipalEntities.unidades
.FirstOrDefault(x => x.uni_codigo == uni_codigo && x.Emp_codigo == Emp_codigo);
the field is of the string type:
public string uni_codigo { get; set; }
My problem is this: when I do a search for a field that receives value "20"
, or starting with any numeric value, the search returns null, but if I search with "metro"
right, I don’t understand what it could be, being that "20"
is considered string also
Registration exists in the database:
When you say "start with any numerical value" do you want to do something like the "like" of SQL? Because in your select will return only values that match exactly the values you specified for both uni_code and Code Emp_code.
– George Wurthmann
That would be my question, do you want an exact search or what contain the value?
– Jéf Bueno
Sorry for the delay, but I want you to return an exact search, the code has to be exactly 20
– Jeff Henrique
The record exists in the database, I will post an image
– Jeff Henrique
The Emp_code in the database is null, out of curiosity, what value you are passing in your Emp_code?
– Leonardo Buta
Ah, you’re right, I didn’t touch that, I pass default value that is 1, that’s the error, post an answer that I accept
– Jeff Henrique