在线求助关于NPIO读取Excel文件的问题~~~~~~~~~~~~~~~~~~~~~~
using( Workbook wb=new HSSFWorkbook(fs))
{
Sheet sheet= wb.GetSheetAt(0);
string title1 = sheet.GetRow(0).GetCell(0).StringCellValue;
string title2 = sheet.GetRow(0).GetCell(1).StringCellValue;
string title3 = sheet.GetRow(0).GetCell(2).StringCellValue;
string title4 = sheet.GetRow(0).GetCell(3).StringCellValue;
string sql = null;
string homephone = null;
string carnum = null;
string carenginnum = null;
int rowsnum=0;
DateTime buytime;
if (title1 == "固定电话" && title2 == "车号" && title3 == "车架号" && title4 == "购买时间")
{
int rowcount = sheet.LastRowNum;
for (int i = 1; i <= rowcount; i++)
{
//导入execl表单元格的数据
homephone = sheet.GetRow(i).GetCell(0).StringCellValue == null ? null : sheet.GetRow(i).GetCell(0).StringCellValue; ;
carnum = sheet.GetRow(i).GetCell(1).StringCellValue == null ? null : sheet.GetRow(i).GetCell(1).StringCellValue;
carenginnum = sheet.GetRow(i).GetCell(2).StringCellValue == null ? null : sheet.GetRow(i).GetCell(2).StringCellValue;
buytime =sheet.GetRow(i).GetCell(3).DateCellValue;