原来代码错误有提示什么问,错在哪里,现在不管哪个代码语句有问题就提示未知编译错误,并且即便改好代码问题后再执行窗口也没有反应了,要重启项目才能正常执行,请老师指点
Dim cb5 As String = e.Form.Controls("combobox5").text
If cb5 >""
Dim dlg As New OpenFileDialog
dlg.Filter = "Excel|*.xls;*.xlsx;*.csv"
If dlg.ShowDialog = DialogResult.OK Then
Dim Book As New XLS.Book(dlg.filename)
Dim Sheet As XLS.Sheet = Book.Sheets(0)
Dim nb As Integer
Dim xsxx As Integer
Dim nj As Integer
Dim fdjs As Integer
Dim dr As DataRow
For i As Integer = 0 To sheet.Cols.count -1
If sheet(0,i).value="类别"
nb = i
End If
If sheet(0,i).value="学生姓名"
xsxx = i
End If
If sheet(0,i).value="年级"
nj = i
End If
If sheet(0,i).value="作品名称"
zpmc = i
End If
If sheet(0,i).value="辅导教师"
fdjs = i
End If
Next
For n As Integer = 1 To Sheet.Rows.Count -1
If Sheet(n,0).Value=""
Continue For
Else
dr= DataTables("科技文化节作品").find("类别='" & sheet(n,nb).value & "'")
If dr Is Nothing
dr = DataTables("科技文化节作品").addnew()
For m As Integer = 0 To sheet.Cols.count -1
If trim(sheet(0,m).text).length=0
Continue For
Else
dr(sheet(0,m).value) = Sheet(n,m).Value.replace(" ","").replace(chr(9),"")
End If
Next
dr("届别")=cb5
dr("县区") = "东兴区"
dr("学校") = _usergroup
dr("所属中心校")=sszxx
dr.save()
End If
End If
Next
End If
Else
messagebox.show("请选择好届别再批量导入,注意不要重复导入")
End If
比如上面代码始终提示未知编译错误,也没提示什么哪句代码错误,并且可果出现一次这个错误,整个项目的其他窗口也不运行了,要重启项目才能够用了,请老师帮看一下
[此贴子已经被作者于2019/9/15 11:11:46编辑过]