Excel to xml & xml to xslt conversion C# [modified]
-
Hi, Anybody knows how to convert an Excel file into XML and XML to XSLT in asp.net 2.0
Thanks & Regards, Jeneesh k. v.
modified on Tuesday, January 12, 2010 11:40 PM
-
Hi, Anybody knows how to convert an Excel file into XML and XML to XSLT in asp.net 2.0
Thanks & Regards, Jeneesh k. v.
modified on Tuesday, January 12, 2010 11:40 PM
Do the following thing : step 1 :load file FileInfo fileinfo = new FileInfo(yourfilePath); step 2 : open file using jet provider string strSql = "SELECT * FROM [" + fileinfo.Name + "]"; string strCSVConnString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + fileinfo.Directory.FullName + ";" + "Extended Properties='text;HDR=No;'"; step 3 : load data set OleDbDataAdapter oleda = new OleDbDataAdapter(strSql, strCSVConnString); DataTable dtbCSV = new DataTable(); oleda.Fill(dtbCSV); step 4 : wite to xml dtbCSV.WriteXml()
-
Hi, Anybody knows how to convert an Excel file into XML and XML to XSLT in asp.net 2.0
Thanks & Regards, Jeneesh k. v.
modified on Tuesday, January 12, 2010 11:40 PM
This might help you Working with MS Excel(xls / xlsx) Using MDAC and Oledb[^] You can read the excel file by the way mentioned and later write it in XML :)
Abhishek Sur **Don't forget to click "Good Answer" if you like this Solution.
My Latest Articles-->** Windows7 API Code Pack
Simplify Code Using NDepend
Basics of Bing Search API using .NET -
Do the following thing : step 1 :load file FileInfo fileinfo = new FileInfo(yourfilePath); step 2 : open file using jet provider string strSql = "SELECT * FROM [" + fileinfo.Name + "]"; string strCSVConnString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + fileinfo.Directory.FullName + ";" + "Extended Properties='text;HDR=No;'"; step 3 : load data set OleDbDataAdapter oleda = new OleDbDataAdapter(strSql, strCSVConnString); DataTable dtbCSV = new DataTable(); oleda.Fill(dtbCSV); step 4 : wite to xml dtbCSV.WriteXml()
yes u r right, when we are using datatable/dataset. But i want any other way without using the datatable/dataset...b'coz it will consume much memory...
Thanks & Regards, Jeneesh k. v.