在系统菜单里做了修改,下面的代码是在表的最下面增加,能改成在第一行插入么?该怎么改?
Dim t As Table = Tables("考勤")
Dim newcount As Integer = 0
t.StopRedraw()
Dim dlg As New OpenFileDialog
dlg.Filter= "Excel文件|*.xls"
If dlg.ShowDialog = DialogResult.Ok Then
Dim Book As New XLS.Book(dlg.FileName)
Dim Sheet As XLS.Sheet = Book.Sheets(0)
For n As Integer = 1 To sheet.Rows.Count - 1
If sheet(n,0).Text.trim() > ""
Dim dr As DataRow = DataTables("考勤").addnew
newcount += 1
dr("编号") = sheet(n,0).Text
dr("考勤年份") = sheet(n,1).text
dr("考勤月份") = sheet(n,2).text
dr("班组") = sheet(n,3).text
dr("用工性质") = sheet(n,4).text
dr("姓名") = sheet(n,5).text
dr("备注") = sheet(n,6).text
End If
Next
MessageBox.Show("本次合并了" & newcount & "条记录" ,"提示!") '提示
End If
t.ResumeRedraw()