以文本方式查看主题 - Foxtable(狐表) (http://foxtable.net/bbs/index.asp) -- 专家坐堂 (http://foxtable.net/bbs/list.asp?boardid=2) ---- 下面这段代码看不出来哪有错误呀? (http://foxtable.net/bbs/dispbbs.asp?boardid=2&id=105746) |
-- 作者:lyzhuo -- 发布时间:2017/8/25 12:03:00 -- 下面这段代码看不出来哪有错误呀? Dim wjma As String = e.Row("单位代码") + "-" + e.Row("单位名称") + "(医疗保险基数填报表)" MessageBox.show(ProjectPath & "\\接收医保\\"& wjma &".xls") Dim Book As New XLS.Book(ProjectPath & "\\接收医保\\"& wjma &".xls") Dim Sheet As XLS.Sheet = Book.Sheets(0) For n As Integer = 2 To sheet.Rows.Count -1 Dim dw As String = sheet(n,0).text Dim xm As String = sheet(n,1).text Dim sfz As String = sheet(n,2).text Dim sbnjs As Double = sheet(n,6).text Dim xbnjs As Double = sheet(n,7).text Dim dr As DataRow = DataTables("基本信息").Find("[单位] = \'" & dw & "\' And [姓名] = \'" & xm & "\' And [身份证号] = \'" & sfz & "\'") If dr Is Nothing Then dr("平均工资2015年") = sbnjs dr("平均工资2016年") = xbnjs End If Next 提示运行错误: .NET Framework 版本:2.0.50727.8669 Foxtable 版本:2017.8.18.1 错误所在事件:单位,DoubleClick 详细错误信息: 从字符串“”到类型“Double”的转换无效。 输入字符串的格式不正确。 |
-- 作者:有点甜 -- 发布时间:2017/8/25 12:10:00 -- 改成
Dim sbnjs As Double = val(sheet(n,6).text) Dim xbnjs As Double = val(sheet(n,7).text)
|
-- 作者:lyzhuo -- 发布时间:2017/8/25 13:15:00 -- 谢谢,一直以为是Find那里出错了 |