ADO appears corrupted?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Anil Gupte/iCinema.com

    #1

    ADO appears corrupted?

    I am having huge problems with my dataset. The change I made was that I was
    reading all the information from a plain text file (include column names and
    data etc.). Now, I have encrypted the file, then I decrypt it (it decrypts
    just fine). I then put the strings obtained in an array and parse each line
    (earlier, I was using readline and then parsing each line). Anyway, to cut
    a long story short, it appears to create the DataSet, but nothing works - it
    won't even recognize the column names. Even in my watch window, if I put in
    an expression, I get an error as shown below:

    ds.Tables("Prof iles").Select(" ProfileID='0'") Run-time exception thrown :
    System.Data.Eva luateException - Cannot find column [ProfileID].

    So you would think I don't have a column by that name. Well in the same
    Watch Window, I get the following:

    ds.Tables("Prof iles").Columns( 0).ColumnName "ProfileID" String

    Which means that column exists! What is going on? And how can I fix it?

    Please help! My software is stuck on this and I am trying to meet a
    deadline!

    Thanx in advance,
    --
    Anil Gupte


  • Siv

    #2
    Re: ADO appears corrupted?

    Anil,
    Just a guess, but do you need the double quotes around the
    "Select("Profil eID='0'") " ie will it work with

    ds.Tables("Prof iles").Select(P rofileID='0')

    Siv
    "Anil Gupte/iCinema.com" <anil-list@icinema.co mwrote in message
    news:u12gm7R1IH A.2292@TK2MSFTN GP03.phx.gbl...
    >I am having huge problems with my dataset. The change I made was that I
    >was reading all the information from a plain text file (include column
    >names and data etc.). Now, I have encrypted the file, then I decrypt it
    >(it decrypts just fine). I then put the strings obtained in an array and
    >parse each line (earlier, I was using readline and then parsing each line).
    >Anyway, to cut a long story short, it appears to create the DataSet, but
    >nothing works - it won't even recognize the column names. Even in my watch
    >window, if I put in an expression, I get an error as shown below:
    >
    ds.Tables("Prof iles").Select(" ProfileID='0'") Run-time exception thrown :
    System.Data.Eva luateException - Cannot find column [ProfileID].
    >
    So you would think I don't have a column by that name. Well in the same
    Watch Window, I get the following:
    >
    ds.Tables("Prof iles").Columns( 0).ColumnName "ProfileID" String
    >
    Which means that column exists! What is going on? And how can I fix it?
    >
    Please help! My software is stuck on this and I am trying to meet a
    deadline!
    >
    Thanx in advance,
    --
    Anil Gupte
    >
    >

    Comment

    • Steve Gerrard

      #3
      Re: ADO appears corrupted?

      Anil Gupte/iCinema.com wrote:
      I am having huge problems with my dataset. The change I made was
      that I was reading all the information from a plain text file
      (include column names and data etc.). Now, I have encrypted the
      file, then I decrypt it (it decrypts just fine). I then put the
      strings obtained in an array and parse each line (earlier, I was
      using readline and then parsing each line). Anyway, to cut a long
      story short, it appears to create the DataSet, but nothing works - it
      won't even recognize the column names. Even in my watch window, if I
      put in an expression, I get an error as shown below:
      ds.Tables("Prof iles").Select(" ProfileID='0'") Run-time exception
      thrown : System.Data.Eva luateException - Cannot find column
      [ProfileID].
      So you would think I don't have a column by that name. Well in the
      same Watch Window, I get the following:
      >
      ds.Tables("Prof iles").Columns( 0).ColumnName "ProfileID" String
      >
      Which means that column exists! What is going on? And how can I fix
      it?
      My first guess would be that the column name 'appears' to be "ProfileID" , but in
      fact has some extra non-printing character on it.
      What does
      ?ds.Tables("Pro files").Columns (0).ColumnName = "ProfileID"
      evaluate to? Is it the same as
      ?
      ?ds.Tables("Pro files").Columns (0).ColumnName. Trim = "ProfileID"

      If you have gone through text, compression, decompression, reconstruct table, it
      seems possible. Going back to that code, and using Trim on all the names before
      assigning them, might clean it up.


      Comment

      • Anil Gupte/iCinema.com

        #4
        Re: ADO appears corrupted?

        No that will not work (Itriedd it just in case). In fact the correct way to
        do it would be

        dim strSelect as string = "ProfileID= '" & defaultprofile & "'"

        dim dr as datarow() = ds.Tables("Prof iles").Select(s trSelect)
        --
        Anil Gupte
        Innovate with UsLeading the Way in Advanced Technology Solutions Discover state-of-the-art services in logistics, databases, and AI designed for evolving

        www.icinema.com

        "Siv" <g@removethiste xtsivill.comwro te in message
        news:9B7D0BD6-67B1-45CE-BA2F-0871CC490911@mi crosoft.com...
        Anil,
        Just a guess, but do you need the double quotes around the
        "Select("Profil eID='0'") " ie will it work with
        >
        ds.Tables("Prof iles").Select(P rofileID='0')
        >
        Siv
        "Anil Gupte/iCinema.com" <anil-list@icinema.co mwrote in message
        news:u12gm7R1IH A.2292@TK2MSFTN GP03.phx.gbl...
        >>I am having huge problems with my dataset. The change I made was that I
        >>was reading all the information from a plain text file (include column
        >>names and data etc.). Now, I have encrypted the file, then I decrypt it
        >>(it decrypts just fine). I then put the strings obtained in an array and
        >>parse each line (earlier, I was using readline and then parsing each
        >>line). Anyway, to cut a long story short, it appears to create the
        >>DataSet, but nothing works - it won't even recognize the column names.
        >>Even in my watch window, if I put in an expression, I get an error as
        >>shown below:
        >>
        >ds.Tables("Pro files").Select( "ProfileID='0'" ) Run-time exception thrown :
        >System.Data.Ev aluateException - Cannot find column [ProfileID].
        >>
        >So you would think I don't have a column by that name. Well in the same
        >Watch Window, I get the following:
        >>
        >ds.Tables("Pro files").Columns (0).ColumnName "ProfileID" String
        >>
        >Which means that column exists! What is going on? And how can I fix it?
        >>
        >Please help! My software is stuck on this and I am trying to meet a
        >deadline!
        >>
        >Thanx in advance,
        >--
        >Anil Gupte
        >>
        >>
        >

        Comment

        • Anil Gupte/iCinema.com

          #5
          Re: ADO appears corrupted?

          I meant to send this to the group:
          I thought that I had checked that, but surprisingly I get

          ds.Tables("Prof iles").Columns( 0).ColumnName = "ProfileID"

          and

          ds.Tables("Prof iles").Columns( 0).ColumnName.L ength = 10

          !!! It should be 9!

          However, I cut and paste the first line into Notepad and Word, but cannot
          see any extraneous characters. Any idea how to solve this puzzle? How does
          one see a "null character"?

          Thanx,
          Anil Gupte

          But anyway, that was the right track. I usedd Trim and it worked! I am
          still wondering where these characters got introduced and what they are
          (they are not spaces or tabs or even the vbNull character).

          Thanx,
          --
          Anil Gupte
          Innovate with UsLeading the Way in Advanced Technology Solutions Discover state-of-the-art services in logistics, databases, and AI designed for evolving

          www.icinema.com

          "Anil Gupte/iCinema.com" <anil-list@icinema.co mwrote in message
          news:u12gm7R1IH A.2292@TK2MSFTN GP03.phx.gbl...
          >I am having huge problems with my dataset. The change I made was that I
          >was reading all the information from a plain text file (include column
          >names and data etc.). Now, I have encrypted the file, then I decrypt it
          >(it decrypts just fine). I then put the strings obtained in an array and
          >parse each line (earlier, I was using readline and then parsing each line).
          >Anyway, to cut a long story short, it appears to create the DataSet, but
          >nothing works - it won't even recognize the column names. Even in my watch
          >window, if I put in an expression, I get an error as shown below:
          >
          ds.Tables("Prof iles").Select(" ProfileID='0'") Run-time exception thrown :
          System.Data.Eva luateException - Cannot find column [ProfileID].
          >
          So you would think I don't have a column by that name. Well in the same
          Watch Window, I get the following:
          >
          ds.Tables("Prof iles").Columns( 0).ColumnName "ProfileID" String
          >
          Which means that column exists! What is going on? And how can I fix it?
          >
          Please help! My software is stuck on this and I am trying to meet a
          deadline!
          >
          Thanx in advance,
          --
          Anil Gupte
          >
          >

          Comment

          • Armin Zingler

            #6
            Re: ADO appears corrupted?

            "Anil Gupte/iCinema.com" <anil-list@icinema.co mschrieb
            I meant to send this to the group:
            I thought that I had checked that, but surprisingly I get
            >
            ds.Tables("Prof iles").Columns( 0).ColumnName = "ProfileID"
            >
            and
            >
            ds.Tables("Prof iles").Columns( 0).ColumnName.L ength = 10
            >
            !!! It should be 9!
            >
            However, I cut and paste the first line into Notepad and Word, but
            cannot see any extraneous characters. Any idea how to solve this
            puzzle? How does one see a "null character"?
            for each c in ds.Tables("Prof iles").Columns( 0).ColumnName
            debug.print(asc w(c).tostring(" X2"))
            next

            Output?


            Armin

            Comment

            Working...