VB Excel Oledb

Work Excel more than 30000 records

Page 1 of 1

1 Replies - 2638 Views - Last Post: 02 January 2009 - 11:18 AM Rate Topic: -----

#1 amirsarb  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 1
  • Joined: 02-January 09

VB Excel Oledb

Post icon  Posted 02 January 2009 - 11:11 AM

I have written a program in vb.net 2005 that takes data from Excel files.
I get the data from the files using OleDbConnection and calculate data with Select query.
My question is:
This is a very time-consuming process, and often not work, when i use a excel file about 29000 record and use select query.
Is there a faster way?

code:
 Dim MyCommand As System.Data.OleDb.OleDbDataAdapter

            MyConnection = New System.Data.OleDb.OleDbConnection("provider=Microsoft.Jet.OLEDB.4.0;Data Source='" & FilePath & "';Extended Properties=Excel 8.0;")

            MyCommand = New System.Data.OleDb.OleDbDataAdapter _
    (query, MyConnection)

            MyCommand.TableMappings.Add("Table", "TestTable")

            Dtset = New System.Data.DataSet
            MyCommand.Fill(Dtset)

            DataGridView1.DataSource = Dtset.Tables(0)

            MyConnection.Close()



Mod Edit: Please use code tags when posting your code. Code tags are used like so => :code:

Thanks,
PsychoCoder :)

Is This A Good Question/Topic? 0
  • +

Replies To: VB Excel Oledb

#2 PsychoCoder  Icon User is offline

  • Google.Sucks.Init(true);
  • member icon

Reputation: 1639
  • View blog
  • Posts: 19,853
  • Joined: 26-July 07

Re: VB Excel Oledb

Posted 02 January 2009 - 11:18 AM

VB 2005 is VB.NET so I'm moving this to the VB.NET forum :)
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1