want to attach one more excel sheet

Posted by Deepakji under C# on 1/8/2012 | Points: 10 | Views : 896 | Status : [Member] | Replies : 2
using System.Data;
using System.Data.OleDb;
...
OleDbConnection con = new OleDbConnection(@"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Book1.xls;Extended Properties=Excel 8.0");
OleDbDataAdapter da = new OleDbDataAdapter("select * from[Sheet1$]", con);
DataTable dt = new DataTable();
da.Fill(dt);


this is how i work with sheet1 but now i want to take from two or more sheets so how i need to do that




Responses

Posted by: Sksamantaray on: 1/10/2012 [Member] Silver | Points: 25

Up
0
Down

try to read data separately from separate worksheet and merge the data

Thanks,
Sanjay

Deepakji, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Deepakji on: 1/10/2012 [Member] Starter | Points: 25

Up
0
Down
Thank you

Deepakji, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response