以文本方式查看主题
- Foxtable(狐表) (http://foxtable.net/bbs/index.asp)
-- 专家坐堂 (http://foxtable.net/bbs/list.asp?boardid=2)
---- 狐表停止运作,求解! (http://foxtable.net/bbs/dispbbs.asp?boardid=2&id=50179)
|
-- 作者:yankunhao
-- 发布时间:2014/4/30 16:57:00
-- 狐表停止运作,求解!
现在发现有部份客户端在运行时出现如下错误,难以发现问题所在,因为根据客户反映,发生错误时正在编辑窗口中的某一文本框,而有些文本框或其所挷定的字段也没什么事件代码的。请问这种情况应如何查找原因?
此主题相关图片如下:img_30042014_151526.png
[此贴子已经被作者于2014-4-30 16:58:21编辑过]
|
-- 作者:狐狸爸爸
-- 发布时间:2014/4/30 16:58:00
--
这个文本框绑定到表中某列,表有事件代码吧?
|
-- 作者:Bin
-- 发布时间:2014/4/30 16:59:00
--
重新安装.NET看看 没有可以重新错误的例子进行调试,没办法判断问题.\'
|
-- 作者:yankunhao
-- 发布时间:2014/4/30 17:01:00
--
DataColChanged事件代码如下:
Select e.DataCol.Name
Case "update_date","sheet_date","user_no","update_user","订单ID" Return Case "wf_cp_gz","wf_bz_fs" ,"cu_part_no","wf_cp_ggrem","wf_edino","wf_jsbkd","wf_bomkd","wf_scbkd","wf_bzkd","sheet_sta"
If e.DataRow.IsNull("订单ID") Then Dim dr As DataRow = DataTables("osal_ord2").Find("part_no = \'" & e.DataRow("part_no") & "\' And [audit_sw] = \'0\'") If dr IsNot Nothing Then dr("国家") = e.DataRow("wf_cp_gz") dr("客户编码") = e.DataRow("cu_part_no") dr("define1") = e.DataRow("wf_bz_fs") dr("rem") = e.DataRow("wf_cp_ggrem") & "/ 电脑纹No." & e.DataRow("wf_edino") & "/ ABUS NO." & e.DataRow("cu_part_no") dr("wf_jsbkd") = e.DataRow("wf_jsbkd") dr("wf_bomkd") = e.DataRow("wf_bomkd") dr("wf_scbkd") = e.DataRow("wf_scbkd") dr("wf_guigesheet_sta") = e.DataRow("sheet_sta") dr("wf_bzkd") = e.DataRow("wf_bzkd") End If Else Dim dr As DataRow = DataTables("osal_ord2").Find("id = " & e.DataRow("订单ID") & " And [audit_sw] = \'0\'") If dr IsNot Nothing Then dr("国家") = e.DataRow("wf_cp_gz") dr("客户编码") = e.DataRow("cu_part_no") dr("define1") = e.DataRow("wf_bz_fs") dr("rem") = e.DataRow("wf_cp_ggrem") & "/ 电脑纹No." & e.DataRow("wf_edino") & "/ ABUS NO." & e.DataRow("cu_part_no") dr("wf_jsbkd") = e.DataRow("wf_jsbkd") dr("wf_bomkd") = e.DataRow("wf_bomkd") dr("wf_scbkd") = e.DataRow("wf_scbkd") dr("wf_guigesheet_sta") = e.DataRow("sheet_sta") dr("wf_bzkd") = e.DataRow("wf_bzkd") Else Return End If End If
Case "wf_bz_hzs","wf_bz_fs","wf_bz_zzs" If e.DataRow("wf_bz_fs")<>"散装" And e.DataRow.IsNull("wf_bz_hzs") Then e.DataRow("wf_bz_ktzs")=Nothing ElseIf e.DataRow("wf_bz_fs")<>"散装" Then \'Dim Digits As Integer = 2 \'Dim Value As Double = e.DataRow("单价")*e.DataRow("数量") e.DataRow("wf_bz_ktzs")=e.DataRow("wf_bz_zzs")/e.DataRow("wf_bz_hzs") \'e.DataRow("正班工资")=Math.Floor(Value * 10 ^ Digits + 0.5) / 10 ^ Digits \'四舍五入 End If Dim dr As DataRow = DataTables("pkl2").Find("part_no = \'" & e.DataRow("part_no") & "\' And sheet_sta = \'未审核\'") If dr IsNot Nothing Then dr("mhsl")= e.DataRow("wf_bz_hzs") dr("mktsl")= e.DataRow("wf_bz_zzs") End If Case "wf_bz_kbktsl" Dim dr As DataRow = DataTables("pkl2").Find("part_no = \'" & e.DataRow("part_no") & "\' And sheet_sta = \'未审核\'") If dr IsNot Nothing Then dr("mkbktsl")= e.DataRow("wf_bz_kbktsl") End If Case "wf_bz_ktzc" Dim dr As DataRow = DataTables("pkl2").Find("part_no = \'" & e.DataRow("part_no") & "\' And sheet_sta = \'未审核\'") If dr IsNot Nothing Then dr("ktjz")= e.DataRow("wf_bz_ktzc") End If Case "wf_bz_ktmz" Dim dr As DataRow = DataTables("pkl2").Find("part_no = \'" & e.DataRow("part_no") & "\' And sheet_sta = \'未审核\'") If dr IsNot Nothing Then dr("ktmz")= e.DataRow("wf_bz_ktmz") End If Case "wf_bz_kbzz" Dim dr As DataRow = DataTables("pkl2").Find("part_no = \'" & e.DataRow("part_no") & "\' And sheet_sta = \'未审核\'") If dr IsNot Nothing Then dr("kbjz")= e.DataRow("wf_bz_kbzz") End If Case "wf_bz_kbmz" Dim dr As DataRow = DataTables("pkl2").Find("part_no = \'" & e.DataRow("part_no") & "\' And sheet_sta = \'未审核\'") If dr IsNot Nothing Then dr("kbmz")= e.DataRow("wf_bz_kbmz") End If Case "wf_bz_kbcq" Dim dr As DataRow = DataTables("pkl2").Find("part_no = \'" & e.DataRow("part_no") & "\' And sheet_sta = \'未审核\'") If dr IsNot Nothing Then Dim bzs As String =e.DataRow("wf_bz_kbcq") If bzs.Contains("*") Then Dim Parts() As String = bzs.Split("*") dr("kbcc_c")= Parts(0) dr("kbcc_k")= Parts(1) dr("kbcc_g")= Parts(2) Else dr("kbcc_c")= e.DataRow("wf_bz_kbcq") dr("kbcc_k")= e.DataRow("wf_bz_kbcqb") dr("kbcc_g")= e.DataRow("wf_bz_kbcc") End If End If
[此贴子已经被作者于2014-4-30 17:05:51编辑过]
|
-- 作者:yankunhao
-- 发布时间:2014/4/30 17:01:00
--
Case "wf_bz_kbcqb" Dim dr As DataRow = DataTables("pkl2").Find("part_no = \'" & e.DataRow("part_no") & "\' And sheet_sta = \'未审核\'") If dr IsNot Nothing Then dr("kbcc_k")= e.DataRow("wf_bz_kbcqb") End If Case "wf_bz_kbcc" Dim dr As DataRow = DataTables("pkl2").Find("part_no = \'" & e.DataRow("part_no") & "\' And sheet_sta = \'未审核\'") If dr IsNot Nothing Then dr("kbcc_g")= e.DataRow("wf_bz_kbcc") End If Case "产品编码" Dim dr As DataRow dr = DataTables("osal_ord2").Find("part_no = \'" & e.DataRow("part_no") & "\'") If dr IsNot Nothing Then e.DataRow("订单ID")=dr("id") End If Case "act_sw" If e.DataRow.IsNull("act_sw") Or e.DataRow("act_sw") = False Then Dim cmd1 As New SQLCommand cmd1.C cmd1.CommandText = "UPDATE {obas_part} SET [act_sw] = 1 Where [part_no] = \'" & e.DataRow("part_no") & "\'" cmd1.ExecuteNonQuery() Dim cmd2 As New SQLCommand cmd2.C cmd2.CommandText = "UPDATE {cpcbsj} SET [sheet_sta] = \'未审核\' Where [part_no] = \'" & e.DataRow("part_no") & "\'" cmd2.ExecuteNonQuery()
ElseIf e.DataRow("act_sw") = True Then Dim cmd1 As New SQLCommand cmd1.C cmd1.CommandText = "UPDATE {obas_part} SET [act_sw] = 0 Where [part_no] = \'" & e.DataRow("part_no") & "\'" cmd1.ExecuteNonQuery() Dim cmd2 As New SQLCommand cmd2.C cmd2.CommandText = "UPDATE {cpcbsj} SET [sheet_sta] = \'已失效\' Where [part_no] = \'" & e.DataRow("part_no") & "\'" cmd2.ExecuteNonQuery()
End If
Case "leadtime" Dim cmd1 As New SQLCommand cmd1.C cmd1.CommandText = "UPDATE {obas_part1} SET [pur_leadtime] = " & e.DataRow("leadtime") & " Where [part_no] = \'" & e.DataRow("part_no") & "\'" cmd1.ExecuteNonQuery()
Case "invodw" Dim dr As DataRow dr = DataTables("Invoice2").Find("part_no = \'" & e.DataRow("part_no") & "\'") If dr IsNot Nothing Then dr("invodw") = e.DataRow("invodw") Else Dim cmd1 As New SQLCommand cmd1.C cmd1.CommandText = "UPDATE {Invoice2} SET [invodw] = \'" & e.DataRow("invodw") & "\' Where [part_no] = \'" & e.DataRow("part_no") & "\'and [sheet_sta] = \'未审核\'" cmd1.ExecuteNonQuery() End If
Case "pakdw" Dim dr As DataRow dr = DataTables("pkl2").Find("part_no = \'" & e.DataRow("part_no") & "\'") If dr IsNot Nothing Then dr("pakdw") = e.DataRow("pakdw") Else Dim cmd1 As New SQLCommand cmd1.C cmd1.CommandText = "UPDATE {pkl2} SET [pakdw] = \'" & e.DataRow("pakdw") & "\' Where [part_no] = \'" & e.DataRow("part_no") & "\'and [sheet_sta] = \'未审核\'" cmd1.ExecuteNonQuery() End If
Case "ktxh" Dim dr As DataRow dr = DataTables("pkl2").Find("part_no = \'" & e.DataRow("part_no") & "\'") If dr IsNot Nothing Then dr("ktxh") = e.DataRow("ktxh") Else Dim cmd1 As New SQLCommand cmd1.C cmd1.CommandText = "UPDATE {pkl2} SET [ktxh] = \'" & e.DataRow("ktxh") & "\' Where [part_no] = \'" & e.DataRow("part_no") & "\'and [sheet_sta] = \'未审核\'" cmd1.ExecuteNonQuery() End If
Case "nfdh" Dim dr As DataRow dr = DataTables("pkl2").Find("part_no = \'" & e.DataRow("part_no") & "\'") If dr IsNot Nothing Then dr("nfdh") = e.DataRow("nfdh") Else Dim cmd1 As New SQLCommand cmd1.C cmd1.CommandText = "UPDATE {pkl2} SET [nfdh] = \'" & e.DataRow("nfdh") & "\' Where [part_no] = \'" & e.DataRow("part_no") & "\'and [sheet_sta] = \'未审核\'" cmd1.ExecuteNonQuery() End If Case Else e.DataRow("update_date")=Date.Now e.DataRow("update_user")=Vars("_UserName") End Select
|
-- 作者:yankunhao
-- 发布时间:2014/4/30 17:05:00
--
今天客户说是正在窗口中输入“wf_cp_ggrem”相关的文本框时就出现错误,而上次是“wf_bz_rem”这个字段相关的多行文本框时也发生同样的错误。
|
-- 作者:有点甜
-- 发布时间:2014/4/30 17:05:00
--
大部分是.net frameword的问题,你重装一下
回复楼上,先自己调试一番,看是否能重现错误。
如果也错误了,就调试一下。http://www.foxtable.com/help/topics/1485.htm
|
-- 作者:狐狸爸爸
-- 发布时间:2014/4/30 17:09:00
--
检查另一个表osal_ord2的事件代码,排除死循环。
|
-- 作者:yankunhao
-- 发布时间:2014/4/30 17:09:00
--
系统是win7繁体版,原本就有.net frameword的请问要重装什么版本的呢?好像win7的版本.net 比较高,不知这个有没影响?最麻烦的是出错时都没提示是那个事件有问题,没从下手。
|
-- 作者:yankunhao
-- 发布时间:2014/4/30 17:23:00
--
表osal_ord2的
DataColChanged
事件代码:
Select e.DataCol.Name Case "sheet_no" If e.DataRow.IsNull("sheet_no") Then e.DataRow("sheet_lot") = Nothing Else Dim lb As String = e.DataRow("sheet_no") If e.DataRow("sheet_lot").StartsWith(lb) = False \'如果单据编号前缀不符 Dim max As String Dim idx As Integer max = e.DataTable.Compute("Max(sheet_lot)","sheet_no = \'" & lb & "\'") \'取得该类别的最大编号 If max > "" Then \'如果存在最大编号 Dim n As Integer n =max.IndexOf("_") If n <>-1 Then idx = CInt(max.Substring(n+1,3)) + 1 \'获得最大编号的后三位顺序号,并加1 End If Else idx = 1 \'否则顺序号等于1 End If e.DataRow("sheet_lot") = lb & "_" & Format(idx,"000") End If End If Case "part_no" Dim cmd As New SQLCommand Dim cmd1 As new SQLCommand Dim dt As DataTable Dim dt1 As DataTable cmd.C cmd.CommandText = "SELECT part_no,wf_cp_gz,wf_cp_ggrem,cu_part_no,wf_bz_fs,wf_edino,cu_part_no,wf_jsbkd,wf_bomkd,wf_scbkd,sheet_sta,wf_bzkd From {obas_part_spec} where [part_no] = \'" & e.DataRow("part_no") &"\'" cmd1.C cmd1.CommandText = "SELECT part_no,sal_unit_no From {obas_part1} where part_no = \'" & e.DataRow("part_no") &"\'" dt = cmd.ExecuteReader() dt1 = cmd1.ExecuteReader() Dim dr As DataRow dr = dt.Find("part_no = \'" & e.DataRow("part_no") & "\'") If dr IsNot Nothing \'如果找到, 则设置各列内容 e.DataRow("国家")= dr("wf_cp_gz") e.DataRow("客户编码")= dr("cu_part_no") e.DataRow("rem")= dr("wf_cp_ggrem") & "/ 电脑纹No." & dr("wf_edino") & "/ ABUS NO." & dr("cu_part_no") e.DataRow("define1")= dr("wf_bz_fs") e.DataRow("wf_jsbkd")= dr("wf_jsbkd") e.DataRow("wf_bomkd")= dr("wf_bomkd") e.DataRow("wf_scbkd")= dr("wf_scbkd") e.DataRow("wf_bzkd")= dr("wf_bzkd")
e.DataRow("wf_guigesheet_sta")= dr("sheet_sta")
Else e.DataRow("国家")= Nothing e.DataRow("客户编码")= Nothing e.DataRow("wf_jsbkd")= Nothing e.DataRow("wf_bomkd")= Nothing e.DataRow("wf_scbkd")= Nothing e.DataRow("wf_guigesheet_sta")= Nothing End If Dim dr1 As DataRow =dt1.DataRows(0) e.DataRow("sal_unit")= dr1("sal_unit_no") Dim dr2 As DataRow=DataTables("料品资料查询表").Find("part_no = \'" & e.DataRow("part_no") & "\'") If dr2 IsNot Nothing Then Return Else Dim s As String =e.DataRow("part_no") If s ="1" Then Return Else \'Dim Filter As String = "[part_no] = \'" & s & "\'" DataTables("料品资料查询表").Load() End If End If Case "wf_answer_date" If e.DataRow.IsNull("wf_answer_date") = False And e.DataRow("affirm_date") <> e.DataRow("wf_answer_date") Then e.DataRow("affirm_date") = e.DataRow("wf_answer_date") End If
End Select
|