473,325 Members | 2,872 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,325 software developers and data experts.

convert excel to xml file

3
i use jet engine ,and oledb database but with this i get four errors which r compile time errores,plz help me to solve these errors
i wrote this programe bt it is not working .
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Data.OleDb;
using System.Net.Security;

public class oledbcon :System.Web.UI.Page
{

public static void main()
{

string connectionstring = " provider=microsoft.jet.oledb.4.0;" & "data source=" & country - State.xml & ";" & "extended properties = excel 8.0;hdr=yes; imex=1;";
OleDbConnection objconnection = new OleDbConnection(connectionstring);
objconnection.Open();
OleDbCommand objcmdselect=new OleDbCommand("select * from [sheet1$]",objconnection);
OleDbDataAdapter objadapter1=new OleDbDataAdapter();
objadapter1.SelectCommand=objcmdselect;
DataSet objdataset1=new DataSet();
objadapter1.Fill(objdataset1);
objconnection.Close();


}
}


errors:
1'.ASP.default_aspx.GetTypeHashCode()': no suitable method found to override
'2.ASP.default_aspx.ProcessRequest(System.Web.Http Context)': no suitable method found to override

3'ASP.default_aspx' does not implement interface member 'System.Web.IHttpHandler.IsReusable'

4ake sure that the class defined in this code file matches the 'inherits' attribute, and that it extends the correct base class (e.g. Page or UserControl).
Jun 29 '07 #1
3 2246
radcaesar
759 Expert 512MB
The following three things need to be done.

(a)

OLD: <%@ Page Language="C#" CompileWith="Default.aspx.cs" ClassName="Default_aspx" %>
NEW: <%@ Page Language="C#" codefile="Default.aspx.cs" Inherits="Default_aspx" %>

(b) In your ASPX.CS source file:

OLD: public partial class Default_aspx
NEW: public partial class Default_aspx : Page

(c)

OLD: sCallBackFunctionInvocation = this.GetCallbackEventReference(this, "message", "ShowServerTime", "context", "OnError");

NEW: sCallBackFunctionInvocation = Page.ClientScript.GetCallbackEventReference(this, "message", "ShowServerTime", "context", "OnError", false);

:)
Jun 29 '07 #2
binny
3
i write a code to convert excel to xml.
bt in this xml every time main tag closed
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Data.OleDb;
using System.Xml;
using System.Xml.XPath;

public partial class _Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
string st = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + Server.MapPath("countries-file.xls") + ";Extended Properties=Excel 8.0; ";
OleDbDataAdapter adp = new OleDbDataAdapter("SELECT * FROM [Sheet1$]", st);
adp.TableMappings.Add("Table", "word");
DataSet ds = new DataSet();

adp.Fill(ds);
//XmlDataDocument doc=new XmlDataDocument(ds);
//doc.Save(Console.Out);

GridView1.DataSource = ds;
GridView1.DataBind();




out put it shows:
<?xml version="1.0" standalone="yes"?>
<NewDataSet>
<Table>
<COUNTRY>Canada</COUNTRY>
<STATE>Alberta </STATE>
<CITY>Airdrome</CITY>
</Table>
<Table>
<CITY>Calgary</CITY>
</Table>
<Table>
<CITY>Camrose</CITY>
</Table>
<Table>
<CITY>Canmore</CITY>
</Table>
<Table>
<CITY>Didzbury</CITY>
</Table>
<Table>
<CITY>Drayton Vally</CITY>
</Table>
<Table>
<CITY>Edmonton</CITY>
</Table>
bt i want
table tag closed only once at last
plz help me how iit is done
Jul 12 '07 #3
binny
3
i write a code to convert excel to xml.
bt in this xml every time main tag closed
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Data.OleDb;
using System.Xml;
using System.Xml.XPath;

public partial class _Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
string st = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + Server.MapPath("countries-file.xls") + ";Extended Properties=Excel 8.0; ";
OleDbDataAdapter adp = new OleDbDataAdapter("SELECT * FROM [Sheet1$]", st);
adp.TableMappings.Add("Table", "word");
DataSet ds = new DataSet();

adp.Fill(ds);
//XmlDataDocument doc=new XmlDataDocument(ds);
//doc.Save(Console.Out);

GridView1.DataSource = ds;
GridView1.DataBind();




out put it shows:
<?xml version="1.0" standalone="yes"?>
<NewDataSet>
<Table>
<COUNTRY>Canada</COUNTRY>
<STATE>Alberta </STATE>
<CITY>Airdrome</CITY>
</Table>
<Table>
<CITY>Calgary</CITY>
</Table>
<Table>
<CITY>Camrose</CITY>
</Table>
<Table>
<CITY>Canmore</CITY>
</Table>
<Table>
<CITY>Didzbury</CITY>
</Table>
<Table>
<CITY>Drayton Vally</CITY>
</Table>
<Table>
<CITY>Edmonton</CITY>
</Table>
bt i want
table tag closed only once at last
plz help me how iit is done
Jul 12 '07 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

5
by: Andrew V. Romero | last post by:
At work we have an excel file that contains the list of medications and their corresponding strengths. I would like to save the excel file as a text list and paste this list into a javascript...
0
by: Alex | last post by:
i have a module in Access which opens an existing Excel file and envokes a macro within the Excel file to draw graphs. now i am trying to convert the Excel macro to an Access one so that the...
2
by: noopathan | last post by:
Hi experts , I have an excel file in the below format --------------------------------------------------------------------- CodeID CodeName Market Name Date...
3
by: Steve | last post by:
Using VB.NET, How do I convert a .txt file extension to a .xls file extension? The text file is already created and saved in a folder on the server. Thanks Steven
8
by: pappu | last post by:
Hello friends, I want to convert .xls file into text file.So can anybody pls help me out. Thxxxxxx, Sachin.
3
by: Alain R. | last post by:
Hi, I have an excel file with charset "windows-1250" and i would like to convert it to CSV file with charset "UTF-8" how can i do that ? thanks a lot, Al.
2
budigila
by: budigila | last post by:
Hiya peeps, Okies, I have been trying to work this out for a while now to no avail... I am a beginner to this whole coding thing but have made great strides in my project. Basically what I am...
32
by: poolboi | last post by:
hi guys, i've read a lot of thread of converting excel data into CSV files. however, i need a perl script to convert CSV file into excel file now, if required modules is needed, it would be...
0
by: Raymond Chiu | last post by:
Dear all, In my vb.net program, I am using excel object to create excel file and stored in a folder. How can it be converted to be pdf file automatically using dotnet coding or others? Actually...
15
by: pakerly | last post by:
How would i do this, convert a test file to excel? Lets say my text file has fields like this: NUMBER NAME ADDRESS PHONE 11002 Test1 ...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.