代码改变世界

读取Excel中的数据

2007-04-27 15:14  ruinet  阅读(282)  评论(0编辑  收藏  举报
  strConn = "Provider = Microsoft.Jet.OLEDB.4.0 ; Data Source =D:\1-2300.xls;Extended Properties=Excel 8.0"
      oleConn 
= New OleDbConnection(strConn)
      da 
= New OleDbDataAdapter("select * from [1$]", strConn)
      da.Fill(ds)
      dgv.DataSource 
= ds.Tables(0)

free web counter