首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 其他教程 > 操作系统 >

Aspose.cell处置Excel2

2012-09-20 
Aspose.cell处理Excel2????(二)从excel中读取数据写到控制台中?using Systemusing System.Collections.Ge

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

热点排行