以文本方式查看主题 - Foxtable(狐表) (http://foxtable.net/bbs/index.asp) -- 专家坐堂 (http://foxtable.net/bbs/list.asp?boardid=2) ---- 移动开发,网络服务端不定时报错 (http://foxtable.net/bbs/dispbbs.asp?boardid=2&id=194858) |
-- 作者:zhchling -- 发布时间:2025/1/21 18:52:00 -- 移动开发,网络服务端不定时报错 做了个按日期列出客户订单的移动开发的网络服务端。 测试正常使用。 过不知道多长时间后,发现网页无法访问, 服务端弹出以下错误提示。 .NET Framework 版本:4.0.30319.42000 Foxtable 版本:2025.1.3.1 错误所在事件:项目,HttpRequest 详细错误信息: 从字符串“”到类型“Date”的转换无效。 问题1: 这个错误是什么原因,怎么查找? 问题2: 有没有办法能监测服务端出现异常,就重启服务端。 问题3. 有什么办法,每隔几个小时,重新启动服务端。 |
-- 作者:zhchling -- 发布时间:2025/1/21 18:56:00 -- Dim wb5 As New WeUI Dim renshuguanwai As Integer Dim renshuwaidian As Integer Dim renshuzijia As Integer Dim renshushanmen As Integer Dim renshuweizhi As Integer Dim renshuzong As Integer Dim zclriqi As Date wb5.AddForm("", "form1", "list.htm") With wb5.AddButtonGroup("form1", "btg2", False) \'水平排列 .Add("btn1", "昨天", "submit").FormAction = "list.htm?btn=1" .Add("btn2", "今日", "submit").FormAction = "list.htm?btn=2" .Add("btn3", "明日", "submit").FormAction = "list.htm?btn=3" .Add("btn4", "<", "submit").FormAction = "list.htm?btn=4" .Add("btn5", ">", "submit").FormAction = "list.htm?btn=5" .Add("btn6", "筛选", "submit").FormAction = "list.htm?btn=6" End With Sel*t Case e.Path Case "list.htm" Dim flt As String \' e.WriteString(e.PostValues("startdate")) If e.GetValues("btn") = 1 Then With wb5.AddInputGroup("form1", "ipg1", "") .AddInput("startdate", "日期", "date").Value = Date.Today.AddDays( - 1)\'e.PostValues("startdate") zclriqi = Date.Today.AddDays( - 1) End With Else End If If e.GetValues("btn") = 2 Then With wb5.AddInputGroup("form1", "ipg1", "") .AddInput("startdate", "日期", "date").Value = Date.Today \'e.PostValues("startdate") zclriqi = Date.Today End With Else End If If e.GetValues("btn") = 3 Then With wb5.AddInputGroup("form1", "ipg1", "") .AddInput("startdate", "日期", "date").Value = Date.Today.AddDays(1) \'e.PostValues("startdate") zclriqi = Date.Today.AddDays(1) End With Else End If If e.GetValues("btn") = 4 Then With wb5.AddInputGroup("form1", "ipg1", "") zclriqi = e.PostValues("startdate") zclriqi = zclriqi.AddDays( - 1) .AddInput("startdate", "日期", "date").Value = zclriqi End With Else End If If e.GetValues("btn") = 5 Then With wb5.AddInputGroup("form1", "ipg1", "") zclriqi = e.PostValues("startdate") zclriqi = zclriqi.AddDays(1) .AddInput("startdate", "日期", "date").Value = zclriqi End With End If If e.GetValues("btn") = 6 Then With wb5.AddInputGroup("form1", "ipg1", "") zclriqi = e.PostValues("startdate") .AddInput("startdate", "日期", "date").Value = zclriqi End With End If flt = "日期=\'" & zclriqi & "\'" \' e.PostValues("startdate") \' msgbox(flt) Dim cmd As New SQLCommand cmd.C cmd.CommandText = " Sele8ct 产品, 时间,组别, 姓名, 人数, 手机, 酒店, 总金额-定金-已收尾款 as 欠款 From ({table_dingdan} Inner Join {table_kehu} On {table_kehu}.[idkehu] = {table_dingdan}.[idkehu]) " If flt > "" Then cmd.CommandText = cmd.CommandText & " where " & flt & " and ( 状态<>\'取消\' or 状态 is null ) Order By 酒店 " End If Dim dt As DataTable = cmd.ExecuteReader With wb5.AddTable("", "Table1") renshuguanwai = dt.compute("sum(人数)", "酒店=\'关外\'") renshuwaidian = dt.compute("sum(人数)", "酒店<>\'关外\' and 酒店<>\'自驾\' and 酒店<>\'\' and 酒店<>\'蓝景\' and 酒店<>\'希尔顿\' and 酒店<>\'皇冠\' and 酒店<>\'黄松浦\' and 酒店<>\'山门\' and 酒店<>\'奶头山\' ") renshuzijia = dt.compute("sum(人数)", "酒店=\'自驾\' ") renshushanmen = dt.compute("sum(人数)", "酒店=\'蓝景\' or 酒店=\'希尔顿\' or 酒店=\'皇冠\' or 酒店=\'黄松浦\' or 酒店=\'山门\' or 酒店=\'奶头山\' ") renshuweizhi = dt.compute("sum(人数)", " 酒店 is null ") renshuzong = dt.compute("sum(人数)") .CreateFromDataTable(cmd.ExecuteReader) With .Body.AddRow() .Attribute = "style=\'background-color:#FFFFE0\'" .AddCell("总人数:" & renshuzong & "人。 其中:关外: " & renshuguanwai & "人,镇上外店:" & renshuwaidian & "人,自驾:" & renshuzijia & "人,山门附近:" & renshushanmen & "人,其他:" & renshuweizhi & "人" , "colspan = \'8\'") End With End With End Sele e.WriteString(wb5.Build)
|
-- 作者:有点蓝 -- 发布时间:2025/1/21 20:10:00 -- 1、先判断有没有提交了日期值 zclriqi = e.PostValues("startdate") 改为 if e.PostValues.containskey("startdate") zclriqi = e.PostValues("startdate") end if 2、3、参考:http://www.foxtable.com/bbs/dispbbs.asp?BoardID=2&ID=173590,屏蔽错误,改为记录日志
|