读书人

Aspose.cell处置Excel2

发布时间: 2012-09-20 09:36:50 作者: rapoo

Aspose.cell处理Excel2

?

?

?

?

(二)从excel中读取数据写到控制台中

?

using System;
using System.Collections.Generic;
using System.Text;
using Aspose.Cells;
namespace FromExcelToDB
{
??? class Program
??? {
??????? static void Main(string[] args)
??????? {
??????????? Workbook book = new Workbook();
??????????? book.Open("student.xlsx");
??????????? Worksheet sheet = book.Worksheets[0];
??????????? Cells cell = sheet.Cells;
???????????
??????????? for (int row = 0; row < cell.MaxDataRow+1; row++)
??????????? {
??????????????? for (int column = 0; column < cell.MaxDataColumn+1; column++)
??????????????? {
??????????????????? Console.WriteLine(cell[row , column].Value);
??????????????? }
??????????? }

??????? }
??? }
}

?

注:若想导入数据库中参照(一);数据库是SQLServer

读书人网 >操作系统

热点推荐