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. General Programming
  3. Visual Basic
  4. importing excel sheet into datagrid

importing excel sheet into datagrid

Scheduled Pinned Locked Moved Visual Basic
databasehelpcsharpasp-net
2 Posts 2 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.
  • S Offline
    S Offline
    sivaram praveen
    wrote on last edited by
    #1

    hi all, In my application vb.net 2003 and ASP.net i have to import excel sheet into sql server 2003 existing table n then into datagrid. I have used this code but throwing an error "System.Data.OleDb.OleDbException: The Microsoft Jet database engine could not find the object. Make sure the object exists and that you spell its name and the path name correctly." Dim connstr As String = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + Server.MapPath("Team wise EMP Profile.xls") + ";Extended Properties=Excel 8.0;" Dim objconn As New OleDbConnection(connstr) Dim ds As New DataSet Dim objadapter As New OleDbDataAdapter("SELECT * FROM Emp_Profile_Tbl", objconn) Try objconn.Open() objadapter.Fill(ds, "nomi") dg.DataSource = ds.Tables(0).DefaultView dg.DataBind() Finally objconn.Close() End Try pls help me

    M 1 Reply Last reply
    0
    • S sivaram praveen

      hi all, In my application vb.net 2003 and ASP.net i have to import excel sheet into sql server 2003 existing table n then into datagrid. I have used this code but throwing an error "System.Data.OleDb.OleDbException: The Microsoft Jet database engine could not find the object. Make sure the object exists and that you spell its name and the path name correctly." Dim connstr As String = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + Server.MapPath("Team wise EMP Profile.xls") + ";Extended Properties=Excel 8.0;" Dim objconn As New OleDbConnection(connstr) Dim ds As New DataSet Dim objadapter As New OleDbDataAdapter("SELECT * FROM Emp_Profile_Tbl", objconn) Try objconn.Open() objadapter.Fill(ds, "nomi") dg.DataSource = ds.Tables(0).DefaultView dg.DataBind() Finally objconn.Close() End Try pls help me

      M Offline
      M Offline
      Michael Sync
      wrote on last edited by
      #2

      sivaram praveen wrote:

      Server.MapPath("Team wise EMP Profile.xls")

      the path of xls file or file name might be wrong..

      Thanks and Regards, Michael Sync ( Blog: http://michaelsync.net)

      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