22,209
社区成员
发帖
与我相关
我的任务
分享
string strCon = @" Provider = Microsoft.Jet.OLEDB.4.0;Data Source ="+ path+";Extended Properties = Excel 8.0;";
OleDbConnection myConn = new OleDbConnection(strCon);
string strCom = " SELECT * FROM [Sheet1$] " ;
myConn.Open();
OleDbDataAdapter myCommand = new OleDbDataAdapter (strCom,myConn) ;
DataSet myDataSet = new DataSet();
myCommand.Fill(myDataSet) ;
myConn.Close();
SqlConn con = new SqlConn();
string str = string.Empty;
int id = 0;
foreach(DataRow r in myDataSet.Tables[0].Rows)