Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. How to dump the filtered data from an excel file in Sql-server 2000

How to dump the filtered data from an excel file in Sql-server 2000

Scheduled Pinned Locked Moved ASP.NET
databasequestionsysadmintutorialcode-review
1 Posts 1 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    MissionSuccess
    wrote on last edited by
    #1

    Respected Gurus I have an excel file which may contains more than 250000 records.I have to dump those reords in my database.I am able to do it,but its very very slow. I have to optimize it. For that i want to filter the records from excel file on the basis of a particular date. I want to give the user flexibility of choosing the date,for which he wants to dump the data.How can i do this?? My sample code is:---- Dim StrReportdate As String StrReportdate = Trim(txtDate.Value) If StrReportdate <> "" Then Dim culture = New CultureInfo("fr-FR", True) dtreportdate = DateTime.Parse(StrReportdate, culture, DateTimeStyles.None) End If Dim strConnectionString As String = String.Empty strConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + strFilePath + ";Extended Properties=""Excel 8.0;HDR=Yes;IMEX=1""" Dim cnCSV As New OleDbConnection(strConnectionString) cnCSV.Open() Dim cmdSelect As New OleDbCommand("SELECT * FROM [sheet1$] where F2=" & dtreportdate, cnCSV) 'Dim cmdSelect As New OleDbCommand("SELECT * FROM [Sheet2$]", cnCSV) Dim daCSV As New OleDbDataAdapter daCSV.SelectCommand = cmdSelect Dim ds As New DataSet daCSV.Fill(ds)

    1 Reply Last reply
    0
    Reply
    • Reply as topic
    Log in to reply
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes


    • Login

    • Don't have an account? Register

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • World
    • Users
    • Groups