data import from excel facing an issue
<p>I am importing data from MS Excel.
The code i have written is,</p>

<pre><code>var ConnectionString = "Provider=Microsoft.ACE.OLEDB.12.0;" + "Data Source=" +
    uploadfile.PostedFile.FileName + ";" + "Extended Properties=Excel 12.0;";
OleDbConnection objConn = new OleDbConnection(sConnectionString);

objConn.Open();
try
{
    var objCmdSelect = new OleDbCommand("select * from [Sheet1$]", objConn);
}
</code></pre>

<p>and so on.</p>

<p>I got an error which looks very generic to me</p>

<p><strong>The Microsoft Office Access database engine could not find the object 'Sheet1$'.  Make sure the object exists and that you spell its name and the path name correctly</strong></p>

<p>*</p>

<blockquote>
  <p>My worksheet name is spelled correclty 
  but for my confirmation, i did below code
  dt = objConn.GetOleDbSchemaTable(OleDbSchemaGuid.Tables, null);</p>
</blockquote>

<pre><code>if(dt == null)
{
  return null;
}

var excelSheets = new String[dt.Rows.Count];
int i = 0;

// Add the sheet name to the string array.
foreach(DataRow row in dt.Rows)
{
  excelSheets[i] = row["TABLE_NAME"].ToString();
  i++;
}
</code></pre>

<p>*
but i got my Data Table null.
My question is the connection is open successfully but i can't read data from the excel file.
<strong>Is there any special Authentication required.?</strong>
because i am getting the above error.</p>
