改一下
If e.DataCol.Name = "A" Then
If e.NewValue = Nothing Then
e.DataRow("B") = Nothing
e.DataRow("C") = Nothing
e.DataRow("D") = Nothing
Else
Dim chars() As Char = {"/", "-"}
Dim ary() As String = e.NewValue.replace("市","市/").replace("区", "区/").replace("路", "路").split(Chars)
For i As Integer = 0 To ary.Length - 1
If ary(i).EndsWith("省") OrElse ary(i).Contains("上海") Then
e.DataRow("B") = ary(i)
Else If ary(i).EndsWith("市") OrElse ary(i).EndsWith("区") Then
e.DataRow("C") = ary(i)
Else If ary(i).EndsWith("县") OrElse ary(i).EndsWith("路") Then
e.DataRow("D") = ary(i)
End If
Next
End If
End If