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

    Question

  • 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
    Wednesday, February 29, 2012 8:09 PM

Answers

  • 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

    Wednesday, February 29, 2012 11:35 PM

All replies

  • 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

    Wednesday, February 29, 2012 11:35 PM
  • Thanks for sharing it here.

    Glad to hear you got a solution.


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

    Friday, March 02, 2012 7:22 AM
    Moderator