I would use Linq-To-DataTable:
decimal value;
if(decimal.TryParse(userInput, out value))
{
var filteredRows = from row in dt.AsEnumerable()
where row.Field<decimal>("Salary") == value
select row;
// if you want an array:
DataRow[] rows = filteredRows.ToArray();
}
If you insist on using DataTable.Select
you have to remove the apostrophes:
DataRow[] rows = table.Select("Salary=" + userInput);
But this presumes that the input value is using the english format(so f.e. not using a different decimal separator like comma that even causes a SyntaxErrorException
).
If the type of the column is actually string
you need to parse it to double or decimal:
var filteredRows = from row in dt.AsEnumerable()
where decimal.Parse(row.Field<string>("Salary")) == value
select row;
But in this cae you should better fix the wrong datatype instead.