Sunday 15 February 2015

asp.net - How to read excel file which is already open by another user in C#.Net -



asp.net - How to read excel file which is already open by another user in C#.Net -

i have excel file open user. please help me out how read it. have tried using next code readonly=true in c#, yet dint solve issue.

string stringconexcelmat = @"provider=microsoft.jet.oledb.4.0;data source=f:\\per_sample\\input\\6787ghhdsgiosack_v02.xls;extended properties=""excel 8.0;hdr=no;imex=1;readonly=true"""; datatable ttable = new datatable("tablemat"); using (oledbconnection conn = new oledbconnection(stringconexcelmat)) { conn.open(); using (oledbdataadapter da = new oledbdataadapter("select * [raw_data$a:t]", conn)) { da.fill(ttable); } } datarow rowvalues = ttable.rows[1];

c# asp.net .net excel c#-4.0

No comments:

Post a Comment