I have to select data from database using LINQ to SQL. There is a condition that i should select only record with ID not containing "0000" at begin ( whole ID number have six digits).
For example when I would want to select data starting with "0000" I will use:
var idList = (from s
in db.TABLE
where s.ID.StartsWith("0000")
select s.ID
);
but I need to use method more like NotStartsWith
or NotContains
instead of StartsWith
. Is that possible?
Have you tried !s.ID.StartsWith("0000")
? (i.e. using the negation operator !
)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With