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. C#
  4. How do I read data from an Excel Spreadsheet with C#?? Please Help!

How do I read data from an Excel Spreadsheet with C#?? Please Help!

Scheduled Pinned Locked Moved C#
questioncsharpdatabasehelp
3 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.
  • A Offline
    A Offline
    AfzalHassen
    wrote on last edited by
    #1

    Hi, I am trying to read data from an Excel spreadsheet :confused: which contains data with which I want to perform string manipulation and then save to SQL srvr.. any advice and help will be greatly appreciated. :) all the data in the spreadsheet are of a string data type.. Thanks Afzal Hassen

    R 1 Reply Last reply
    0
    • A AfzalHassen

      Hi, I am trying to read data from an Excel spreadsheet :confused: which contains data with which I want to perform string manipulation and then save to SQL srvr.. any advice and help will be greatly appreciated. :) all the data in the spreadsheet are of a string data type.. Thanks Afzal Hassen

      R Offline
      R Offline
      Ritesh1234
      wrote on last edited by
      #2

      Hi, if u want to retrieve data using OLEDB Object than this link will help u. http://support.microsoft.com/default.aspx?scid=kb;en-us;316831[^] else u if u want to read data cell wise u can use........... Dim exlApp As New Excel.Application() Dim exlBook As Excel.Workbook = exlApp.Workbooks.Open(tbFileName.Text.Trim) Dim exlSheet As Excel.Worksheet = exlBook.Worksheets.Item(tbWorkBook.Text.Trim) for intCounter = 1 to TotalRows strFirstColValue= exlSheet.Cells.Range("A1" & intCounter).Value 'after reading values u can insert these into Datatable using New dataRow....\ next I hope this will help u................:-> Regards, Ritesh

      C 1 Reply Last reply
      0
      • R Ritesh1234

        Hi, if u want to retrieve data using OLEDB Object than this link will help u. http://support.microsoft.com/default.aspx?scid=kb;en-us;316831[^] else u if u want to read data cell wise u can use........... Dim exlApp As New Excel.Application() Dim exlBook As Excel.Workbook = exlApp.Workbooks.Open(tbFileName.Text.Trim) Dim exlSheet As Excel.Worksheet = exlBook.Worksheets.Item(tbWorkBook.Text.Trim) for intCounter = 1 to TotalRows strFirstColValue= exlSheet.Cells.Range("A1" & intCounter).Value 'after reading values u can insert these into Datatable using New dataRow....\ next I hope this will help u................:-> Regards, Ritesh

        C Offline
        C Offline
        Colin Angus Mackay
        wrote on last edited by
        #3

        That looks like VB code. That'd be fightin' talk 'round here, pardner. ;P


        My: Blog | Photos | Next SQL Presentation WDevs.com - Open Source Code Hosting, Blogs, FTP, Mail and More

        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