如何在html页面中显示Excel数据 [英] how to show Excel data in html page
本文介绍了如何在html页面中显示Excel数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想将excel数据显示到html页面?
如果可能的话,在sql server数据库中没有导入。
i want to show excel data to html page ?
if possible without import in sql server database.
推荐答案
你好,
请参阅解决方案,该解决方案将读取Excel数据并绑定到数据网格
Hi,
See the solution, which will read excel data and bind to the datagrid
DataSet objDataSet = new DataSet();
string strConn = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source="
+ Server.MapPath(".") + "\\wk16.xls;" + "Extended Properties='Excel 8.0;'";
OledbDataAdapter objDataAdapter = new OledbDataAdapter("SELECT * FROM [Sheet1
,strConn);
objDataAdapter.Fill(objDataSet);
DataGrid1.DataSource = objDataSet.Tables [ 0 ]。DefaultView;
DataGrid1.DataBind();
", strConn); objDataAdapter.Fill(objDataSet); DataGrid1.DataSource = objDataSet.Tables[0].DefaultView; DataGrid1.DataBind();
谢谢!!!
Thanks!!!
如果是只是为了显示,您可以使用 IFrame
- 嵌入并直接在HTML页面中显示Excel。
If it just for display, you can use IFrame
- embed and show the excel in your HTML page directly.
这篇关于如何在html页面中显示Excel数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文