Reading XML content to generate html page dynamically

Posted by Pravambekar under XML on 4/4/2014 | Points: 10 | Views : 2179 | Status : [Member] | Replies : 1
Hello Expert,

Can u help in situation where i have little different requirement ! i have few xls file which contains link based content which navigates to another sheet on click of content.

I need to convert this excel file into xml and want to read this xml in C# application where i need to show xml content dynamically creating html code ..

Currently i have statically created one xml file which contains node and sub node in the file which i m reading in dataset in code behind and displaying it by created run time html table and binding it to html div. but this does not full fill my requirement as .. few xml file may have nested which is difficult to read in dataset, i have no clue how i can read xml in my own format.

moreover you can suggest if any best alternative available...

Help highly appriciated


Posted by: Oliver32 on: 4/11/2014 [Member] Starter | Points: 25

According to your requirments,I'd like to share you with the following sample codes-Excel to XML using C#
using System;

using System.Data;
using System.Windows.Forms;
using System.Xml;
using System.Data;

namespace WindowsApplication1
public partial class Form1 : Form
public Form1()

private void button1_Click(object sender, EventArgs e)
System.Data.OleDb.OleDbConnection MyConnection ;
System.Data.DataSet ds ;
System.Data.OleDb.OleDbDataAdapter MyCommand ;
MyConnection = new System.Data.OleDb.OleDbConnection("provider=Microsoft.Jet.OLEDB.4.0;Data Source='Specify path here \\xl2xml.xls';Extended Properties=Excel 8.0;");
MyCommand = new System.Data.OleDb.OleDbDataAdapter("select * from [Sheet1$]", MyConnection);
MyCommand.TableMappings.Add("Table", "Product");
ds = new System.Data.DataSet();
catch (Exception ex)
MessageBox.Show (ex.ToString());


Or you can refer:


Pravambekar, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response