none
OLEDB Data Adapter query Excel Worksheet from Workbook by Name RRS feed

  • Question

  • Hi,

    i am trying to fill a dataset in c# using an oledbdataadapter from an excel worksheet.

    As soon as i have ab blank or & in the worksheet name like 'one two & three' i get an error message that the name is too large or it contains invalid  characters.

    All tables where the table name does not contain a blank or a & work perfect.

    A query to the table names of the workbook reports the worksheet name 'one two & three' correct.

    Any idea what to do to prevent against this error?

    Thanks in advance

    de Kekse

    Monday, August 13, 2018 8:36 AM

All replies

  • Hi,

    Can you verify(modify or remove invalid characters)  the worksheet name before processing your data ? 

    Please post your details code here, thanks.

    Best Regards,

    Simon



    MSDN Community Support Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread.

    Monday, August 13, 2018 9:28 AM
    Moderator