在做项目时,经常遇到要将Excel中的大量数据导入到Access数据库中,原来的做法是读一条写一条,若导入上万条的数据需要几分仲时间,速度很慢 string strsql = "insert into Users select MinYingLi,MaxYingLi,CiShu from [sheet1$] in ’" + ofd.FileName + "’ ’Excel 8.0;’ where MinYingLi is not null"; Database db = new Database(); db.InsertPiLiang(strsql); |