最好还是判断一下是否存在符合条件的行:
If e.Value IsNot Nothing Then dim dr AS dataRow =datatables("XX").Find("编号='" & e.Value & "'") if dr isnot nothing then e.value = dr ("存值的列名") end ifEnd If