Question: The following linq

```
var subjectMarks = (from DataRow row in objDatatable.Rows
                    select Convert.ToDecimal(row["EXM_MARKS"])).Sum();

```

throws an exception since some `row["EXM_MARKS"]` has non numeric values like `AB` etc.
How can I get the sum of only numeric ones out of them?

Answer: 
For linq to sql queries you can use built-in `SqlFunctions.IsNumeric`

Source: [SqlFunctions.IsNumeric](https://learn.microsoft.com/en-us/dotnet/api/system.data.objects.sqlclient.sqlfunctions.isnumeric?view=netframework-4.7.2)
use 

```
Decimal Z;

var subjectMarks = (from DataRow row in objDatatable.Rows
                     where Decimal.TryParse (row["EXM_MARKS"], out Z)
                     select Convert.ToDecimal(row["EXM_MARKS"])).Sum();

```