我们如何才能将Excel单元格的数据types更改为CellValues.String从C#

我们如何改变c#中每个excel列的DataType = CellValues.String。

for (int index = 0; index < NoOfRecords; index++) { for (int j = 0; j < colCount; j++) { mWSheet1.Cells[(rowCount) + index, j + 1] =Convert.ToString(ResultsData.Rows[index][j].ToString()); } } 

把string格式(“'”+)放在每个集合的frond中

 for (int index = 0; index < NoOfRecords; index++) { for (int j = 0; j < colCount; j++) { mWSheet1.Cells[(rowCount) + index, j + 1] ="'"+Convert.ToString(ResultsData.Rows[index][j].ToString()); } }