I have a file uploader in a web page which allows to upload excel files only, hwat I want to do is in the code , to open the excel file and get the values in the excel file which Is in different cells to the mdf file in visual studio 2008, how can I do this
I an using Asp.NET and C#

I tried out but I need a help ,
If someone could give me a link or some guidelines
Appreciate a lot
thanxxxx

Recommended Answers

All 2 Replies

I have a file uploader in a web page which allows to upload excel files only, hwat I want to do is in the code , to open the excel file and get the values in the excel file which Is in different cells to the mdf file in visual studio 2008, how can I do this
I an using Asp.NET and C#

I tried out but I need a help ,
If someone could give me a link or some guidelines
Appreciate a lot
thanxxxx

can't remember which one of these actually works but one of these does you will just have to try it out


//OleDbConnection conn;
//OleDbCommand comm;
//OleDbDataReader dr;
//Response.Write(Server.MapPath("Query2.xls"));
//conn = new OleDbConnection("Provider = Microsoft.Jet.OLEDB.4.0; Data Source = " + Server.MapPath("Query2.xls"));

//conn.Open();
//OleDbDataAdapter da = new OleDbDataAdapter();
//da.SelectCommand = new OleDbCommand("Select * from [users$]", conn);

//comm = new OleDbCommand("Select * from Query1", conn);
//OleDbDataAdapter da = new OleDbDataAdapter("Select * from usersExport", conn);
//comm

//OleDbConnection con = new OleDbConnection(@"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + Server.MapPath("koldb.xls")+";Extended Properties=Excel 8.0");
//OleDbDataAdapter da = new OleDbDataAdapter("select * from [Sheet1$]", con);


//DataTable dt = new DataTable();
//da.Fill(dt);

can't remember which one of these actually works but one of these does you will just have to try it out


//OleDbConnection conn;
//OleDbCommand comm;
//OleDbDataReader dr;
//Response.Write(Server.MapPath("Query2.xls"));
//conn = new OleDbConnection("Provider = Microsoft.Jet.OLEDB.4.0; Data Source = " + Server.MapPath("Query2.xls"));

//conn.Open();
//OleDbDataAdapter da = new OleDbDataAdapter();
//da.SelectCommand = new OleDbCommand("Select * from [users$]", conn);

//comm = new OleDbCommand("Select * from Query1", conn);
//OleDbDataAdapter da = new OleDbDataAdapter("Select * from usersExport", conn);
//comm

//OleDbConnection con = new OleDbConnection(@"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + Server.MapPath("koldb.xls")+";Extended Properties=Excel 8.0");
//OleDbDataAdapter da = new OleDbDataAdapter("select * from [Sheet1$]", con);


//DataTable dt = new DataTable();
//da.Fill(dt);

hey waht do you mean ine of these how many are there, can you separate and describe the lines,
please
thanxx

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.