This is my code:
// Taken from combobox selection.
string columnName = cboCrudSearchColumn.Text.ToString();
// Taken from textbox selection.
string searchValue = txtCrudSearch.Text.ToString();
dgvLoadTable.DataSource = EntityName
.TableName
.Where(columnName + " = @0", searchValue )
.ToList();
Now, this works fine when searchValue is a string (ex: ABC), but when it is a numeric value (ex: 30) it gives the following exception: Operator '=' incompatible with operand types 'Decimal' and 'String. How can I overcome this problem?