How select just numeric values in LINQ?

  • Thread starter Thread starter Ronald S. Cook
  • Start date Start date
R

Ronald S. Cook

We have a table "Animal" that contains the column "AnimalNumber" with values
like these:

100001
100002
100003
1XAB
10E43ABC
11RU5V

Having letters in the value was done in the past. These days, it's just a
the numeric value.

How can I write a LINQ statement to select only the numeric values? E.g.:

100001
100002
100003

Thanks fror any help,
Ron
 
Ronald S. Cook said:
We have a table "Animal" that contains the column "AnimalNumber" with values
like these:

100001
100002
100003
1XAB
10E43ABC
11RU5V

Having letters in the value was done in the past. These days, it's just a
the numeric value.

How can I write a LINQ statement to select only the numeric values? E.g.:

100001
100002
100003

Hmm... that sounds tricky, to be honest. Can you not either remove the
data from the server, or fetch the redundant data and then prune it out
on the client?
 
I havent used linq but

you could try.


from number in numbers
where IsNumber(number)

write your IsNumber or use double.TryParse
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Back
Top