表中有ABC三列。
希望ABC中的任何一列修改值时,如果A&B&C已经有相同数据,则不允许修改
select case e.col.name
case "A","B","C"
dim x as string = ""
select case e.col.name
case "A"
x = e.newvalue & " " & e.datarow("B") & " " & e.datarow("C")
case "B"
x = e.datarow("A") & " " & e.newvalue & " " & e.datarow("C")
case "C"
……
end select
dim dr as datarow = e.datatable.find("FullCol = '" & x & "'") '这里FullCol 是A + ‘ ’ + B + ‘ ’ + C的表达式
if dr isnot nothing then
e.cancel = true
end if
end select
感觉这样写有点麻烦了,有没有简单点的做法?