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. excel file into dataset

excel file into dataset

Scheduled Pinned Locked Moved ASP.NET
helpcomquestion
4 Posts 3 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.
  • J Offline
    J Offline
    jphuphilly
    wrote on last edited by
    #1

    Can someone please help? I know there should be a way to do this but i just can't find it or figure it out. Any help would be greatly appreciated, thanks.... I am getting the following error message: System.Data.OleDb.OleDbException: Invalid internet address. Line 53: Line 54: Line 55: MyConnection.Open() Line 56: ' Select the data from Sheet1 of the workbook. Line 57: MyCommand = New System.Data.OleDb.OleDbDataAdapter( _ strpath = "http://www.myserver.com/viewexcel.csv" Dim DS As System.Data.DataSet Dim MyCommand As System.Data.OleDb.OleDbDataAdapter Dim MyConnection As System.Data.OleDb.OleDbConnection Dim myconstr As String = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source='" & strPath & "';Extended Properties=""Excel 8.0;HDR=Yes;IMEX=1""" MyConnection = New System.Data.OleDb.OleDbConnection(myconstr) MyConnection.Open() ' Select the data from Sheet1 of the workbook. MyCommand = New System.Data.OleDb.OleDbDataAdapter( _ "select * from [ViewExcel$]", MyConnection) DS = New System.Data.DataSet MyCommand.Fill(DS) MyConnection.Close() dgTest.DataSource = DS dgTest.DataBind() Da Intern

    M S 2 Replies Last reply
    0
    • J jphuphilly

      Can someone please help? I know there should be a way to do this but i just can't find it or figure it out. Any help would be greatly appreciated, thanks.... I am getting the following error message: System.Data.OleDb.OleDbException: Invalid internet address. Line 53: Line 54: Line 55: MyConnection.Open() Line 56: ' Select the data from Sheet1 of the workbook. Line 57: MyCommand = New System.Data.OleDb.OleDbDataAdapter( _ strpath = "http://www.myserver.com/viewexcel.csv" Dim DS As System.Data.DataSet Dim MyCommand As System.Data.OleDb.OleDbDataAdapter Dim MyConnection As System.Data.OleDb.OleDbConnection Dim myconstr As String = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source='" & strPath & "';Extended Properties=""Excel 8.0;HDR=Yes;IMEX=1""" MyConnection = New System.Data.OleDb.OleDbConnection(myconstr) MyConnection.Open() ' Select the data from Sheet1 of the workbook. MyCommand = New System.Data.OleDb.OleDbDataAdapter( _ "select * from [ViewExcel$]", MyConnection) DS = New System.Data.DataSet MyCommand.Fill(DS) MyConnection.Close() dgTest.DataSource = DS dgTest.DataBind() Da Intern

      M Offline
      M Offline
      Mike Ellison
      wrote on last edited by
      #2

      Do you need the embedded quotes around the Data Source parameter in the connection string?

      J 1 Reply Last reply
      0
      • J jphuphilly

        Can someone please help? I know there should be a way to do this but i just can't find it or figure it out. Any help would be greatly appreciated, thanks.... I am getting the following error message: System.Data.OleDb.OleDbException: Invalid internet address. Line 53: Line 54: Line 55: MyConnection.Open() Line 56: ' Select the data from Sheet1 of the workbook. Line 57: MyCommand = New System.Data.OleDb.OleDbDataAdapter( _ strpath = "http://www.myserver.com/viewexcel.csv" Dim DS As System.Data.DataSet Dim MyCommand As System.Data.OleDb.OleDbDataAdapter Dim MyConnection As System.Data.OleDb.OleDbConnection Dim myconstr As String = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source='" & strPath & "';Extended Properties=""Excel 8.0;HDR=Yes;IMEX=1""" MyConnection = New System.Data.OleDb.OleDbConnection(myconstr) MyConnection.Open() ' Select the data from Sheet1 of the workbook. MyCommand = New System.Data.OleDb.OleDbDataAdapter( _ "select * from [ViewExcel$]", MyConnection) DS = New System.Data.DataSet MyCommand.Fill(DS) MyConnection.Close() dgTest.DataSource = DS dgTest.DataBind() Da Intern

        S Offline
        S Offline
        Sean89
        wrote on last edited by
        #3

        Hes right i dont think you need the quotes around the data source path. Wacky waving inflateable arm flailing tube man! - Family Guy

        1 Reply Last reply
        0
        • M Mike Ellison

          Do you need the embedded quotes around the Data Source parameter in the connection string?

          J Offline
          J Offline
          jphuphilly
          wrote on last edited by
          #4

          Still getting same error message. Da Intern

          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