OLEDB, Writing Excel cell without leading apostrophe

后端 未结 8 1579
长情又很酷
长情又很酷 2020-12-19 07:51

I\'m writing to Excel file using OLEDB (C#). What I need is just RAW data format.

I\'ve noticed all cells (headers and values) are prefixed by apostrophe (\')

<
8条回答
  •  别那么骄傲
    2020-12-19 08:49

    http://support.microsoft.com/kb/257819 has a statement to the effect that this behaviour might be unavoidable when inserting text into Excel via ADO:

    A caution about editing Excel data with ADO: When you insert text data into Excel with ADO, the text value is preceded with a single quote. This may cause problems later in working with the new data.

    Is the data explicitly text, might it be coerced into a numeric format? (clutching at straws...)

提交回复
热议问题