I need to select the rows of a table where a column value is numeric, any Help?
EDIT: I have a varchar column and I need to select the ones that are numbers and the
(Edited to suit your needs)
So, given the fact that you cannot use Integer.TryParse, the following is not feasible:
int i;
var rowsWithInts = (From r In dc.YourRows Where Integer.TryParse(r.Column, i));
var rowsWithoutInts = (From r In dc.YourRows Where !Integer.TryParse(r.Column, i));
Is it possible that you create a stored procedure and link it to the DataContext via the Methods Pane? In that case you can do in your SQL the following:
-- Rows with integers
SELECT * FROM your_table WHERE ISNUMERIC(varchar_column) = 1
-- Rows without integers
SELECT * FROM your_table WHERE ISNUMERIC(varchar_column) = 0
Does this helps?