::
::
::
::
::
Code
using System.Data.OleDb;
//数据读取
string strCon = " Provider = Microsoft.Jet.OLEDB.4.0 ; Data Source =E:/a.xls;Extended Properties=Excel 8.0";
OleDbConnection myConn = new OleDbConnection(strCon);
string strCom = " SELECT * FROM [ProductInfo$] ";
myConn.Open();
OleDbDataAdapter myCommand = new OleDbDataAdapter(strCom, myConn);
DataSet myDataSet = new DataSet();
myCommand.Fill(myDataSet, "[ProductInfo$]");
myConn.Close();
for (int i = 0; i < myDataSet.Tables[0].Rows.Count; i++)
{
//数据处理
}
只为记录自己曾经做过东西,方便下次需要时调用。
posted on
2009-03-18 11:00
Miler
阅读(
152)
评论()
编辑
收藏
举报