如何阅读openoffice excel电子表格并将其绑定到datagridview [英] How to read openoffice excel spreadsheet and bind it to datagridview

查看:92
本文介绍了如何阅读openoffice excel电子表格并将其绑定到datagridview的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何将OpenOffice excel电子表格读取到datagridview.i能够在文本框中显示我的OpenOffice电子表格的路径,但无法将其绑定到datagridview我该怎么做呢。使用c#windows表单。



我尝试过:



private void button1_Click(object sender,EventArgs e)

{

OpenFileDialog openfiledailog1 = new OpenFileDialog();

if(openfiledailog1.ShowDialog()== System.Windows.Forms.DialogResult。好的)

{

this.txt_path.Text = openfiledailog1.FileName;

}

how to read the OpenOffice excel spread sheet to datagridview.i am able to display the path of my OpenOffice spread sheet in textbox but unable to bind it to datagridview how can i do this.using c# windows forms.

What I have tried:

private void button1_Click(object sender, EventArgs e)
{
OpenFileDialog openfiledailog1 = new OpenFileDialog();
if (openfiledailog1.ShowDialog() == System.Windows.Forms.DialogResult.OK)
{
this.txt_path.Text = openfiledailog1.FileName;
}

推荐答案

最简单的方法是使用一个读取office文件的库。

也许这对你有用吗? SpreadsheetLight for .NET Framework
Easiest way is to use a library that reads office files.
Maybe this works for you? SpreadsheetLight for .NET Framework


这篇关于如何阅读openoffice excel电子表格并将其绑定到datagridview的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆