steps:
1) create simple dotnet application(here i am used C#.net)
2) put the below code
//add namespace
using System.Data.OleDb;
//read Excel File
string FilePath =”c:\test.xls”;
OleDbConnection con = new OleDbConnection(@"Provider=Microsoft.Jet.OLEDB.4.0;Data Source="+ FilePath +";Extended Properties=Excel 8.0");
OleDbDataAdapter da = new OleDbDataAdapter("select * from [sheet1$]", con);
DataTable dt = new DataTable();
//get data in datatable
da.Fill(dt);
--------
Happy coding..
Friday, April 1, 2011
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment