Select Case e.DataCol.name Case "证件号码" If e.DataRow.IsNull("证件号码") Then e.DataRow("原籍地址") = Nothing e.DataRow("性别") = Nothing Else e.DataRow("性别") = ReadSex(e.DataRow("证件号码")) Dim bm As String = e.DataRow("证件号码").SubString(0,6) Dim dr As DataRow = DataTables("身份证号码归属").Find("编码 = '" & bm & "'") If dr IsNot Nothing Then e.DataRow("原籍地址") = dr("地址") End If