文件名称:winform Excel读取数据到 DataGridView
文件大小:1KB
文件格式:RAR
更新时间:2018-04-06 03:20:17
DataGridView
winform Excel读取数据到 DataGridView byte[] content; FileStream fs = File.OpenRead(open.FileName); content = new byte[fs.Length]; fs.Read(content, 0, content.Length); fs.Close(); string fileExName = open.FileName; strPath = fileExName; string strConn = "Provider=Microsoft.Jet.OLEDB.4.0;" + "Data Source=" + fileExName + ";" + "Extended Properties=Excel 8.0;"; OleDbConnection con = new OleDbConnection(strConn); con.Open(); string[] names = GetExcelSheetNames(con, ShiftCount);
【文件预览】:
TExcel.cs