Select Case e.DataCol.name
Case "cpbm"
If e.DataCol.Name = "cpbm" Then
If e.DataRow.IsNull("cpbm") Then
e.DataRow("fxrq") = Nothing
e.DataRow("qxrq") = Nothing
' e.DataRow("zxrq") = Nothing
Else
If e.DataRow.rowstate <> DataRowState.Unchanged Then
Dim ddr0 As DataRow
Dim max As Date
max = e.DataTable.Compute("Max(zxrq)")
ddr0 = DataTables("dk_lxb").Find("[cpbm] = '" & e.DataRow("cpbm") & "'","zxrq desc")
If ddr0 IsNot Nothing
Dim zx1 As Date = ddr0("zxrq") '止息日期
Dim zx2 As Date = zx1.addmonths(1) '第二次止息日期
Dim fx1 As Date = ddr0("fxrq")
Dim fx2 As Date = fx1.addmonths(1)
Dim qx1 As Date = ddr0("qxrq")
Dim qx2 As Date = qx1.addmonths(1)
e.DataRow("fxrq") = fx2
e.DataRow("qxrq") = qx2
Dim d As Date = e.DataRow("qxrq")
If d.Day = 1 Then
e.DataRow("zxrq") = new Date(d.Year,d.Month,Date.DaysInMonth(d.Year,d.Month))
Else
e.DataRow("zxrq") = zx2
End If
End If
End If
End If
End If
End Select
以上代码我要写在chick按钮事件里,增加一行后执行。提示e.DataCol不是....成员。对这种情况如何处理呢?类似这种情况如何变通?