执行的代码如下:
Dim Names2 As String() = {"姓名","年龄","电话","地址"}
Dim k As String = e.Form.Controls("号码").value
Dim dr As DataRow = DataTables("blk").SQLFind("blh = '" & k & "'")
If dr Is Nothing Then
MessageBox.Show("已不存在!","错误提示",MessageBoxButtons.OK, MessageBoxIcon.Warning)
Else
For Each Name2 As String In Names2
Select Case Name2
Case "年龄"
Dim rq As Date = dr("csrq")
Dim n As Integer = val(e.Form.Controls("年龄").value)
Dim dtrq As Integer = _fwqrq.year
n = dtrq - n
Dim y As Integer = rq.month
Dim r As Integer = rq.day
Dim LastDay As Date = New Date(n,y,r)
dr("csrq") = LastDay
dr("nl") = n
Case Else
If e.Form.Controls(Name2).value = "" Then
dr(GetPY(Name2, True)) = ""
Else
dr(GetPY(Name2, True)) = Functions.Execute("加解密","加密",e.Form.Controls(Name2).value)
End If
End Select
Next
dr.save
end if
注析:如果将 “dr.save” 删除就不会报错,但加上去 就报错了,不知道怎么回事,但是我删除 bin文件夹后,重新启动项目执行“dr.save” 又正常,再执行就又会报错,请问这是什么原因造成的呢?
报错如下图
此主题相关图片如下:qq图片20160823160346.png
[此贴子已经被作者于2016/8/23 17:32:17编辑过]