On Fri, 13 Aug 2004 10:25:10 +0530, "Akhil" <asdads> wrote:
¤ Hi All,
¤
¤ How to import data from Excel to dataset?
¤ Code please,if Possible.
Dim ConnectionString As String
ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=e:\My Documents\Book20.xls;Extended Properties=""Excel 8.0;HDR=NO"""
Dim ExcelConnection As New System.Data.OleDb.OleDbConnection(ConnectionString)
ExcelConnection.Open()
Dim da As New System.Data.OleDb.OleDbDataAdapter("Select * from [Sheet8$]", ExcelConnection)
Dim ds As New DataSet("Workbooks")
da.Fill(ds, "Sheet8")
Paul ~~~ (e-mail address removed)
Microsoft MVP (Visual Basic)