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. writing excel cell values to generic list using c#

writing excel cell values to generic list using c#

Scheduled Pinned Locked Moved C#
helpcsharp
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.
  • R Offline
    R Offline
    ramyanaidu
    wrote on last edited by
    #1

    Sketchs.Add(new SKETCH(SketchWorkSheet.Cells[i, 3].ToString(), SketchWorkSheet.Cells[i, 4].ToString(), SketchWorkSheet.Cells[i, 5].ToString(), SketchWorkSheet.Cells[i, 6].ToString(), SketchWorkSheet.Cells[i, 7].ToString(), SketchWorkSheet.Cells[i, 8].ToString(), Convert.ToDouble(SketchWorkSheet.Cells[i,9]))); when i run this i get an error as Input string was not in a correct format Can any one help me in this

    RamyaNaidu

    M 1 Reply Last reply
    0
    • R ramyanaidu

      Sketchs.Add(new SKETCH(SketchWorkSheet.Cells[i, 3].ToString(), SketchWorkSheet.Cells[i, 4].ToString(), SketchWorkSheet.Cells[i, 5].ToString(), SketchWorkSheet.Cells[i, 6].ToString(), SketchWorkSheet.Cells[i, 7].ToString(), SketchWorkSheet.Cells[i, 8].ToString(), Convert.ToDouble(SketchWorkSheet.Cells[i,9]))); when i run this i get an error as Input string was not in a correct format Can any one help me in this

      RamyaNaidu

      M Offline
      M Offline
      Malcolm Smart
      wrote on last edited by
      #2

      ramyanaidu wrote:

      Sketchs.Add(new SKETCH(SketchWorkSheet.Cells[i, 3].ToString(), SketchWorkSheet.Cells[i, 4].ToString(), SketchWorkSheet.Cells[i, 5].ToString(), SketchWorkSheet.Cells[i, 6].ToString(), SketchWorkSheet.Cells[i, 7].ToString(), SketchWorkSheet.Cells[i, 8].ToString(), Convert.ToDouble(SketchWorkSheet.Cells[i,9]))); when i run this i get an error as Input string was not in a correct format Can any one help me in this

      Yep, we may be able to. But we need a clue - like what is in each of these cells. What parameter types SKETCH is expecting. Try expanding your code to

      string cell3 = SketchWorkSheet.Cells[i, 3].ToString();
      string cell4 = SketchWorkSheet.Cells[i, 4].ToString();

      Then pass cell3 and cell4 etc as parameters to the main call. Your debugger, and as a result, you, will have far more chance of seeing what is going on. The problem, at a guess is with the conversion to double Convert.ToDouble(SketchWorkSheet.Cells[i,9])); Convert Cells[i,9] to a string, look at the value in a debugger and I imagine you will see the problem.

      Small angry dogs

      modified on Monday, December 17, 2007 6:28:14 AM

      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