not reading all rows of excel in datatable
<p>Hello I am trying to read excel in datatable,
I write code like below. I used this code many time for erad excel in datatable, but this time my excel is complex. and this exsting code is not reading some some rows which is very important me, could you please suggest me.
  DataTable obDataTable = new DataTable();
        Dictionary props = new Dictionary();</p>

<pre><code>    if (file.EndsWith(".xlsx"))
    {
        props["Provider"] = "Microsoft.ACE.OLEDB.12.0;";
        props["Extended Properties"] = "Excel 12.0 XML";
    }
    else if (file.EndsWith(".xls"))
    {
        props["Provider"] = "Microsoft.Jet.OLEDB.4.0";
        props["Extended Properties"] = "Excel 8.0";
    }
    else
        return null;

    props["Data Source"] = file;

    StringBuilder sb = new StringBuilder();

    foreach (KeyValuePair&lt;string, string&gt; prop in props)
    {
        sb.Append(prop.Key);
        sb.Append('=');
        sb.Append(prop.Value);
        sb.Append(';');
    }

    string connectionString = sb.ToString();
    using (OleDbConnection conn = new OleDbConnection(connectionString))
    {
        conn.Open();
        OleDbCommand cmd = new OleDbCommand();
        cmd.Connection = conn;
        DataTable dtSheet = conn.GetOleDbSchemaTable(OleDbSchemaGuid.Tables, null);
        foreach (DataRow dr in dtSheet.Rows)
        {
            string sheetName = dr["TABLE_NAME"].ToString();
            cmd.CommandText = "SELECT * FROM [" + sheetName + "]";
            DataTable dt = new DataTable();
            dt.TableName = sheetName.Replace("$", string.Empty);
            OleDbDataAdapter da = new OleDbDataAdapter(cmd);
            da.Fill(obDataTable);
            //da.Fill(dt);

            //ds.Tables.Add(dt);
        }

        cmd = null;
        conn.Close();
    }

    return obDataTable;
}
</code></pre>
