Dim cmd As new SQLCommand
cmd.C
cmd.CommandText = "S/LECT * FROM {申请表} where sfzh='" & e.PostValues("sfzh") & "'"
Dim dt As DataTable = cmd.ExecuteReader(True)
If dt.DataRows.Count>0
dr = dt.DataRows(0)
Else
dr=dt.AddNew()
End If
。。。。。
dr("类别")=e.PostValues("类型说明").Substring(0,1) & "2"
dr("年份")=val(e.Cookies("xsbj").Substring(2,4))+6
dr("sqsj")=Date.Today()
dr("bh")= e.PostValues("类型说明").Substring(0,1) & "2" & right(dr("_identify"),4)
dr("bkxx")=e.PostValues("byxx")
dr.save()
因为这里要保存才有_identify, 所以先保存了,再用下一句来生成bh
dt.SQLReplaceFor("bh", "类别" & "Right([_Identify],4)", "sfzh='" & e.Cookies("username") & "'",True)
其中bh为字符型,类别也为字符型,现在的结果是没有结果,也没提示