以文本方式查看主题

-  Foxtable(狐表)  (http://www.foxtable.com/bbs/index.asp)
--  专家坐堂  (http://www.foxtable.com/bbs/list.asp?boardid=2)
----  欲判断列是否表达式列时出错  (http://www.foxtable.com/bbs/dispbbs.asp?boardid=2&id=19530)

--  作者:kylin
--  发布时间:2012/5/13 10:00:00
--  欲判断列是否表达式列时出错

 

For Each dc As DataCol In DataTables("订单").DataCols
  if dc.Expression is nothing

      MessageBox.Show("表达式列")

  end if

Next

 

会出现read only的错误


--  作者:狐狸爸爸
--  发布时间:2012/5/13 10:02:00
--  

我测试正常,不过最好这么改一下。

 

For Each dc As DataCol In DataTables("订单").DataCols
  if dc.Expression > "" then

    MessageBox.Show("表达式列")

   end if

Next

 

 


--  作者:程兴刚
--  发布时间:2012/5/13 11:01:00
--  
以下是引用狐狸爸爸在2012-5-13 10:02:00的发言:

我测试正常,不过最好这么改一下。

 

For Each dc As DataCol In DataTables("订单").DataCols
  if dc.Expression > "" then

    MessageBox.Show("表达式列")

   end if

Next

 

 

 

如果是表达式列,我又没有写入表达式怎么办?

         能否直接增加判断列类型的方法!


--  作者:狐狸爸爸
--  发布时间:2012/5/14 8:22:00
--  
老程,没有写入表达式的话,dc.Expression > ""就不成立的