以文本方式查看主题

-  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=94555)

--  作者:luckbetter333
--  发布时间:2016/12/26 19:05:00
--  还是相同内容报错
编码如下
Select Case e.DataCol.name
    Case "产品类别","特征1","特征2","特征3","特征4","特征5","特征6","特征7","特征8"
        Dim dr As DataRow = e.DataRow
            If e.DataTable.Compute("Count([_Identify])","产品类别 = \'" & dr("产品类别") & "\' And 特征1 = \'" & dr("特征1") & "\'And 特征2 = \'" & dr("特征2") & "\'And 特征3 = \'" & dr("特征3") & "\'And 特征4 = \'" & dr("特征4") & "\'And 特征5 = \'" & dr("特征5") & "\'And 特征6 = \'" & dr("特征6") & "\'And 特征7 = \'" & dr("特征7") & "\'And 特征8 = \'" & dr("特征8") & "\'") > 1 Then
                MessageBox.Show("已经存在相同的产品!","提示",MessageBoxButtons.OK,MessageBoxIcon.Information)
                e.DataRow(e.DataCol.Name) = e.OldValue \'取消输入
        End If
End Select

结果是产品类别和8个特征都输入内容并且相同时报错,想改成只输入产品类别和其中几个特征相同,剩余的特征空着,也报错,要怎样改?

--  作者:有点蓝
--  发布时间:2016/12/26 20:23:00
--  
没有办法改,你知道9个列的随机排列组合有多少种可能吗?

必须有一点的规则规定,比如

1、特征列不能为空
2、指定具体某几个列进行判断