最近教学中,需要用到WinForm 读取Excel数据,于是就做了一个简单的,废话不多说,直接codding... //读取Excel的帮助类 class SqExcellHelper { public static DataTable GetData(string tablename) { DataTable dtEmp = new DataTable(tablename); OleDbConnection con = new OleDbConnection(); // Persist Sec…
Dim objExcelFile As Excel.Application Dim objWorkBook As Excel.Workbook Dim objSheet As Excel.Worksheet objExcelFile = New Excel.Application objExcelFile.DisplayAlerts = False objWorkBook = objExcelFile.Workbooks.Open(filePath) objSheet = objWorkBook…