Dim dlg As New OpenFileDialog '定义一个新的OpenFileDialog dlg.Filter= "Excel文件|*.xlsx" '设置筛选器 If dlg.ShowDialog = DialogResult.Ok Then '如果用户单击了确定按钮 Dim Book As New XLS.Book(dlg.FileName) Dim Sheet As XLS.Sheet = Book.Sheets(0) Dim dr As DataRow = DataTables("表C").AddNew dr("姓名") = sheet(0,1).Text dr("性别") = sheet(1,1).text dr("民族") = sheet(2,1).text dr("住址") = sheet(3,1).text dr("公民身份号码") = sheet(4,1).text End If
|