Set data type like number, text and date in excel column using Microsoft.Office.Interop.Excel in c#

前端 未结 3 1082
猫巷女王i
猫巷女王i 2020-12-01 21:32

My problem is that I am trying to set data type to an excel column in C#, in this case the data types number, text and date. I am using the DLL Microsoft.Office.Interop.Exce

3条回答
  •  无人及你
    2020-12-01 22:19

    There is an answer to a question I asked on this some time back.

    Most notably, the data types this guy uses in his answer are:

    private struct ExcelDataTypes
    {
        public const string NUMBER = "NUMBER";
        public const string DATETIME = "DATETIME";
        public const string TEXT = "TEXT"; // also works with "STRING".
    }
    

    Look familiar?

    If you are interested, here is the link:

    Insert DataTable into Excel Using Microsoft Access Database Engine via OleDb

提交回复
热议问题