Click here to Skip to main content
15,904,877 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
i want to show excel data to html page ?
if possible without import in sql server database.
Posted
Comments
OraSeale 12-Jun-15 4:33am    
Is it an .xlsx or an .xls file? If you have a newer .xlsx file then you could try using the OpenXML SDK. If you have .xls then you'll have to go with some other approach. For example you can try this solution for reading excel files in .NET. Actually with that approach you can pretty easily achieve the .NET's conversion of excel (both .xlsx and .xls) into a .html.

Hi,
See the solution, which will read excel data and bind to the datagrid
C#
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();


Thanks!!!
 
Share this answer
 
v3
If it just for display, you can use IFrame - embed and show the excel in your HTML page directly.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900