OLEDB and EXCEL Worksheet Problem
-
string constr = "Provider=Microsoft.Jet.OLEDB.4.0;" + "Data Source=" + Serverpath + "\\" + Session.SessionID + "1" + "." + fileext + ";Extended Properties=\"Excel 8.0;HDR=NO;IMEX=1\""; OleDbConnection con = new OleDbConnection(constr); con.Open(); OleDbCommand com = new OleDbCommand("SELECT * FROM [Sheetname$]", con); In the query sheetname is worksheet name. my sheet name will change frequently. is ther any way to access sheet name using sheet INDEX its very urgent ...... Thnaks in advance....
-
string constr = "Provider=Microsoft.Jet.OLEDB.4.0;" + "Data Source=" + Serverpath + "\\" + Session.SessionID + "1" + "." + fileext + ";Extended Properties=\"Excel 8.0;HDR=NO;IMEX=1\""; OleDbConnection con = new OleDbConnection(constr); con.Open(); OleDbCommand com = new OleDbCommand("SELECT * FROM [Sheetname$]", con); In the query sheetname is worksheet name. my sheet name will change frequently. is ther any way to access sheet name using sheet INDEX its very urgent ...... Thnaks in advance....
-
string constr = "Provider=Microsoft.Jet.OLEDB.4.0;" + "Data Source=" + Serverpath + "\\" + Session.SessionID + "1" + "." + fileext + ";Extended Properties=\"Excel 8.0;HDR=NO;IMEX=1\""; OleDbConnection con = new OleDbConnection(constr); con.Open(); OleDbCommand com = new OleDbCommand("SELECT * FROM [Sheetname$]", con); In the query sheetname is worksheet name. my sheet name will change frequently. is ther any way to access sheet name using sheet INDEX its very urgent ...... Thnaks in advance....
mithun narayanan wrote:
its very urgent ......
Isn't it always - but only to you, nobody else cares. In the time it took you to post the question you could have tried it for yourself, so why don't you just go into debug and try it?
Bob Ashfield Consultants Ltd