title: 'DBNULL error' while summing column on datatable using LINQ
body: <p>I'm sure this is a pretty simple one, but I can't seem to find an answer anywhere...</p>
  
  <p>i am trying to sum numeric values from a datatable using linq  but because there are also null values in column K i am getting a error:
  <code>Cannot cast DBNull.Value to type 'System.Int32'. Please use a nullable type.</code> 
  what is the proper syntax to overcome this error?</p>
  
  <pre><code>   Private table1 As DataTable
  Private Function getIncome(ByVal acName As String, ByVal acTeam As String) As Integer
      Dim query = table1.AsEnumerable().Where(Function(x) x.Field(Of String)("G") = acName AndAlso x.Field(Of String)("F") = acTeam _
                      ).Sum(Function(x) x.Field(Of Integer)("K"))
  
      Dim total As Integer = query
      Return total
  End Function 
  </code></pre>