我正在尝试做一些我认为很简单的事情。
我有一个名为 loc 的列表。然后我有代码
dim locdt = nothing
locdt = EML_StaffingDataSet.TSTAFFRSTR.Select.Where(Function(x As DataRow) loc.Contains(x.Item("rstr_location"))).Distinct
这很好用,但是当我尝试使 locdt 成为控件的数据源时,我收到一个空错误,“从类型 'DBNull' 到类型'String' 的转换无效。” 一些 rstr_locations 是空的,所以在上面的代码中,我如何从选择中删除空值。