Load data from excel file
<p>I have an excel file with the structure as the below.
I want to read data from this file. There are 2 ways to do that:
- Using OLEDB to load to DB. But in this case, it seemly can not do that. </p>

<pre><code>       String sConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;" + "Data Source=" + ExcelFileName + ";" + "Extended Properties=Excel 8.0;";

        OleDbConnection objConn = new OleDbConnection(sConnectionString);
        objConn.Open();
        OleDbCommand objCmdSelect = new OleDbCommand("SELECT * FROM [Sheet1$]", objConn);
        OleDbDataAdapter objAdapter1 = new OleDbDataAdapter();
        objAdapter1.SelectCommand = objCmdSelect;

        DataSet objDataset1 = new DataSet();
        objAdapter1.Fill(objDataset1);
</code></pre>

<ul>
<li>Using Excel object. In this case, how can i know what last cell which has data?</li>
</ul>

<p><img src="http://img31.imageshack.us/img31/6736/unstructureexcel.png" alt="alt text"></p>

<p>Thanks</p>
