贴出代码:Dim time As String time = Date.Today.AddDays(-2).Date.ToString Dim sql As String Dim ds As New DataTable() sql = "select zhfrq,ggwjbh from T_ZLGL_GGWJJBXX where zhfrq>'" + time + "'" Dim adapter As New OleDb.OleDbDataAdapter(sql, OleDbConnection1) Try OleDbConnection1.Open() adapter.Fill(ds) DataGrid1.DataSource = ds DataGrid1.DataBind() If ds.Rows.Count = 0 Then Table5.Rows(0).Cells(0).InnerText = "最近两天没有发出更改文件" End If Catch mye As Exception #If DEBUG Then Response.Write(mye.ToString) #End If alert("数据库读取错误!") Finally OleDbConnection1.Close() End Try 是不是因为在where子句中使用时间字段?
是的 我现在已经改掉这个查询了 改为:select ggwjbh,zhfrq from t_zlgl_ggwjjbxx where zhfrq > sysdate-2 有钱写的那个sql查询语句很烂啊 汗, 目前还没有出现那个问题 另外我升级了msda2.7的sp1 再观察一段时间 不知道各位还有什么地方可以给俺一个建议
错误的原因是有个try{}catch{}语句出现错误没有处理,然后在后来保留抛出了~~你可以说具体点,我帮你看看~~~
to :wangin8181(綠野人) 您说的try{}catch{}语句错误没有处理,能不能说详细一点,
是只是捕捉到错误,但是没有处理,还是没有捕捉错误
你用什么连接字符串?
我改成Provider=MSDAORA;Persist Security Info=False;User ID=;password=;Data Source="/>,问题解决!
time = Date.Today.AddDays(-2).Date.ToString
Dim sql As String
Dim ds As New DataTable()
sql = "select zhfrq,ggwjbh from T_ZLGL_GGWJJBXX where zhfrq>'" + time + "'"
Dim adapter As New OleDb.OleDbDataAdapter(sql, OleDbConnection1)
Try
OleDbConnection1.Open()
adapter.Fill(ds)
DataGrid1.DataSource = ds
DataGrid1.DataBind()
If ds.Rows.Count = 0 Then
Table5.Rows(0).Cells(0).InnerText = "最近两天没有发出更改文件"
End If Catch mye As Exception
#If DEBUG Then
Response.Write(mye.ToString)
#End If
alert("数据库读取错误!")
Finally
OleDbConnection1.Close()
End Try
是不是因为在where子句中使用时间字段?
我现在已经改掉这个查询了
改为:select ggwjbh,zhfrq from t_zlgl_ggwjjbxx where zhfrq > sysdate-2
有钱写的那个sql查询语句很烂啊 汗,
目前还没有出现那个问题
另外我升级了msda2.7的sp1
再观察一段时间
不知道各位还有什么地方可以给俺一个建议