以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.com/bbs/index.asp)
--  专家坐堂  (http://foxtable.com/bbs/list.asp?boardid=2)
----  e.DataRow("性别") = ReadSex(e.DataRow("身份证号码"))报错?  (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=67288)

--  作者:zgjmost
--  发布时间:2015/4/21 20:54:00
--  e.DataRow("性别") = ReadSex(e.DataRow("身份证号码"))报错?
 
For Each R As Row In Tables("毕业生报表").Rows
    If r("身份证号") IsNot Nothing Then
       e.DataRow("性别") = ReadSex(e.DataRow("身份证号码"))
    End If
Next
 
报错?

--  作者:有点甜
--  发布时间:2015/4/21 21:45:00
--  
提问要养成好习惯,既然报错,你最好就告知错误提示,方便别人分析。

代码这样改一下:

For Each R As Row In Tables("毕业生报表").Rows    
      If r.IsNull("身份证号") = false Then
          r("性别") = ReadSex(r("身份证号码"))
      End If
Next

--  作者:zgjmost
--  发布时间:2015/4/22 0:57:00
--  

好的,谢谢,有点甜老师!