0

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

2
Contributors
2
Replies
4
Views
7 Years
Discussion Span
Last Post by judithSampathwa
0

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);

0

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

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.