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. InvalidCast Exception in Typed Dataset

InvalidCast Exception in Typed Dataset

Scheduled Pinned Locked Moved C#
databasesysadminhelpannouncement
3 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
    sameerhanda
    wrote on last edited by
    #1

    Ok maybe I am going dumb here, but I cannot for the life of me figure this problem out. In the MSDE database there is a column called Slides. In that Slide table there is a Version column. Which is defined as a string. It contains data like 1.0.0. Well i am trying to create a typedataset where I just dragged and dropped the Slide table from the server explorer. That being said, when I go in for the Fill command, I keep getting the InvalidCastException. I tried changing the column types to double etc...but no go. Any suggestion. Thanks Sameer

    S 1 Reply Last reply
    0
    • S sameerhanda

      Ok maybe I am going dumb here, but I cannot for the life of me figure this problem out. In the MSDE database there is a column called Slides. In that Slide table there is a Version column. Which is defined as a string. It contains data like 1.0.0. Well i am trying to create a typedataset where I just dragged and dropped the Slide table from the server explorer. That being said, when I go in for the Fill command, I keep getting the InvalidCastException. I tried changing the column types to double etc...but no go. Any suggestion. Thanks Sameer

      S Offline
      S Offline
      snouto
      wrote on last edited by
      #2

      1- use float casting . or 2- change the column data type into float numbers and tell us what did you get still having that problem or not ? Mess With The Best And Die Like The Rest

      S 1 Reply Last reply
      0
      • S snouto

        1- use float casting . or 2- change the column data type into float numbers and tell us what did you get still having that problem or not ? Mess With The Best And Die Like The Rest

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

        Actually I am an idiot...the problem was in my DAL. When I wrote this function called RunSqlReturnDS( string cmd , table ) well lets just say I hardcoded the table array position..i.e m_dataHolder.Tables[0].Rows..you get the idea. So, it was returning rows from the previous run of the function.

        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