C#读取Excel的三种方式以及比较分析

2019-12-30 11:04:22王冬梅
  • DataRow dataRow = data.NewRow();  for (int j = row.FirstCellNum; j < cellCount; ++j) 
  • {  if (row.GetCell(j) != null) //同理,没有数据的单元格都默认是null 
  • dataRow[j] = row.GetCell(j).ToString();  } 
  • data.Rows.Add(dataRow);  } 
  • }  return data; 
  • }  catch (Exception ex) 
  • {  Console.WriteLine("Exception: " + ex.Message); 
  • return null;  } 
  • 下面是一些相关的文章,大家可以参考下


    注:相关教程知识阅读请移步到c#教程频道。