Dim dd As DataRow = e.DataRow Select Case e.DataCol.Name Case "序1" If dd.IsNull("序1") Then '如果数量或单价为空 dd ("序号1") = Nothing Else dd ("序号1") = dd("零件编号") + "01" End If End Select Select Case e.DataCol.Name Case "序2" If dd.IsNull("序2") Then '如果数量或单价为空 dd ("序号2") = Nothing Else dd ("序号2") = dd("零件编号") + "02" End If End Select