WPF读取EXCEL

string strConn = "Provider=Microsoft.Jet.OLEDB.4.0;" +"Data Source="+ Path +";"+"Extended Properties=Excel 12.0;";
OleDbConnection conn = new OleDbConnection(strConn);
conn.Open(); 
string strExcel = ""; 
OleDbDataAdapter myCommand = null;
DataSet ds = null;
strExcel="select * from [sheet1$]";
myCommand = new OleDbDataAdapter(strExcel, strConn);
ds = new DataSet();
myCommand.Fill(ds,"table1"); 
return ds;

红色代码抛一场:找不到可安装的 ISAM,我怀疑蓝色代码有问题,但是找不到原因


繁星coding
浏览 822回答 1
1回答
打开App,查看更多内容
随时随地看视频慕课网APP