主题:[讨论]excel 導數據到sql
string strCon;
strCon = " Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + Server.MapPath("excel.xls") + "; Extended Properties=Excel 8.0;";
SqlConnection olecon = new SqlConnection(strCon);
SqlDataAdapter myda = new SqlDataAdapter("SELECT * FROM [Sheet1$]", strCon);
DataSet myds = new DataSet();
myda.Fill(myds);
fan ti hui luan ma,nin neng tie chu dai ma lai ma ?
wo jiang shi fen gan ji,zheng de heng ji ,wo dou gao hao ji tian le !!
strCon = " Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + Server.MapPath("excel.xls") + "; Extended Properties=Excel 8.0;";
SqlConnection olecon = new SqlConnection(strCon);
SqlDataAdapter myda = new SqlDataAdapter("SELECT * FROM [Sheet1$]", strCon);
DataSet myds = new DataSet();
myda.Fill(myds);
fan ti hui luan ma,nin neng tie chu dai ma lai ma ?
wo jiang shi fen gan ji,zheng de heng ji ,wo dou gao hao ji tian le !!