How to read an Excel spreadsheet in c# quickly

前端 未结 5 1112
被撕碎了的回忆
被撕碎了的回忆 2020-12-05 06:13

I am using Microsoft.Office.Interop.Excel to read a spreadsheet that is open in memory.

gXlWs = (Microsoft.Office.Interop.Excel.Worksheet)gXlApp.ActiveWorkbo         


        
5条回答
  •  谎友^
    谎友^ (楼主)
    2020-12-05 06:31

    I am not sure the "Convert" is efficient. Is there anyway I could do this faster?

    What makes you believe this? I promise you that Convert.ToString() is the most effective method in the code you posted. Your problem is that your looping through 180,000 records in an excel document...

    You could split the work up since you know the number of row this is trival to do.

    Why are you coverting Value2 to a string exactly?

提交回复
热议问题