using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using NPOI.HSSF.UserModel;
using System.IO;
using NPOI.HSSF.Record.Formula.Functions;
namespace MysqlWinform
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void skinButton1_Click(object sender, EventArgs e)
{
//using (FileStream fs = new FileStream(@"C:\Users\Administrator\Desktop\Excel\goodstype1.xls", FileMode.Open, FileAccess.Read))
//{
// HSSFWorkbook work = new HSSFWorkbook(fs);
// HSSFSheet sheet = work.GetSheetAt(0);
// HSSFRow row = null;
// goodstype gt = null;
// zlyfmallEntities db = new zlyfmallEntities();
// for (int i = 1; i <= sheet.LastRowNum; i++)
// {
// row = sheet.GetRow(i);
// gt = new goodstype();
// gt.tname = row.GetCell(0).ToString();
// gt.status = int.Parse(row.GetCell(1).ToSt
使用C#对Excel进行读写操作(NPOI)以及使用EF对Mysql进行CURD
最新推荐文章于 2025-05-18 09:00:10 发布