C# Loding csv to datatable string value are not getting

Locked C# Loding csv to datatable string value are not getting

  • Wednesday, February 29, 2012 8:09 PM
     
      Has Code

    Hello I do have  CSV files  and I'm loading in to datatable

    COL1	 COL2
    ====   =======
    1	 45
    2	 5
    1rf	 5
    45	 5

    Now I'm having issue  that I'm not able to get 1rf  value in to data table.

    please advise me


    Regards, Vik


    • Edited by VKommineni Wednesday, February 29, 2012 8:35 PM Subject changed
    • Changed Type VKommineni Wednesday, February 29, 2012 10:09 PM
    •  

All Replies

  • Wednesday, February 29, 2012 11:35 PM
     
     Answered

    Here you  go for the solution :

    http://stackoverflow.com/questions/4551203/help-with-a-oledb-connection-string-for-excel-files
                    
                    Unfortunately, you can't set ImportMixedTypes or TypeGuessRows from the connection string since those settings are defined in the registry. For the ACE OleDb driver, they're stored at 
                    HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Office\12.0\Access Connectivity Engine\Engines\Excel  in the registry
                    [HKEY_LOCAL_MACHINE\Software\Microsoft\Jet\4.0\Engines\Excel\TypeGuessRows ----> TypeGuessRows =0;
                    HKEY_LOCAL_MACHINE\Software\Microsoft\Jet\4.0\Engines\test\MaxScanRows ----->MaxScanRows=0;


    Regards, Vik

  • Friday, March 02, 2012 7:22 AM
    Moderator
     
     

    Thanks for sharing it here.

    Glad to hear you got a solution.


    Best Regards,
    Rocky Yue[MSFT]
    MSDN Community Support | Feedback to us