如何在Microsoft Excel中插入数据-重新发布 [英] How to Insert Datas in Microsoft Excel - Repost

查看:81
本文介绍了如何在Microsoft Excel中插入数据-重新发布的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何使用c#

推荐答案

在Microsoft Excel中将数据插入Windows应用程序中的DataGridView中

Look it

string connstr ="Provider=Microsoft.Jet.Oledb.4.0;Data Source=C:\aaa.xls;Extended Properties=Excel 8.0"/>
        OleDbConnection conn = new OleDbConnection(connstr);
        string strSQL = "SELECT * FROM [Sheet


"; OleDbCommand cmd = new OleDbCommand(strSQL, conn); DataSet ds = new DataSet(); OleDbDataAdapter da = new OleDbDataAdapter(cmd); da.Fill(ds); GridView1.DataSource = ds; GridView1.DataBind();
"; OleDbCommand cmd = new OleDbCommand(strSQL, conn); DataSet ds = new DataSet(); OleDbDataAdapter da = new OleDbDataAdapter(cmd); da.Fill(ds); GridView1.DataSource = ds; GridView1.DataBind();


您已经收到此问题的答案
You already received answers to this question here[^]. Please do not repost the same question but edit your original.


这篇关于如何在Microsoft Excel中插入数据-重新发布的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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