逆水行船

别人的天堂,是我的异乡;无端的繁华,倍添我的惆怅

 

excel操作

 string path = @"F:\Documents and Settings\Administrator\My Documents\sql.xls";
            OleDbConnection conn = new OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Extended Properties=Excel 8.0;data source=" + path);
            OleDbDataAdapter dapter = new OleDbDataAdapter("SELECT * FROM [SQL$]", conn);
            DataTable dt = new DataTable();
            dapter.Fill(dt);
            int rows = dt.Rows.Count;
            PositionBN bn = new PositionBN();
            for (int i = 0; i < rows; i++)
            {
                bn.Execute(dt.Rows[i][0].ToString());
            }

posted on 2007-10-31 17:01  荣-  阅读(164)  评论(0编辑  收藏  举报

导航