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);
1