I am inserting data into Sql table from excel sheet.
oledbConnection.GetSchema("Table_Name")
getting excel sheet names in sorted order. I dont want them to be sorted coz i want to get the first sheet in order to perform some operations on it. Here is my code snippet.
string con = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=" + excel +";Extended Properties=\"Excel 12.0;HDR=Yes;IMEX=2\"";
OleDbConnection cn = new OleDbConnection(con);
cn.Open();
DataTable sheetTable = cn.GetSchema("Tables");
string strSHeetName = Convert.ToString(sheetTable.Rows[0]["TABLE_NAME"]);
any help would be highly appreciated.