C# 读取Excel模板数据
/// <summary>
/// 读取Excel文件数据
/// </summary>
/// <param name="filePath"></param>
/// <returns></returns>
/// <exception cref="Exception"></exception>
public DataSet ReadFile(string filePath)
{
string strConn = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=" + filePath + ";Extended Properties=Excel 12.0;";
OleDbConnection conn = new OleDbConnection(strConn)