C# At opening large Excel file (150MB) by OledbConnection System.OutOfMemoryException
<p>I have to open a large excel file 150MB with half millon of records (excel 2007 .xlsx file) , and i have to migrate it to sql server, I use oledbconnection , however when I try to open the connection it takes more than 5 minutes and after that a System.OutMemoryExcepion appears. I think this connection tries to open all file in memory , how can I read row by row.
I am working with Visual Net 2005 and C#</p>

<pre><code>string archivoExcel="c:\largeExcel.xlsx"
string conneStringInraSIS = "Provider=Microsoft.ACE.OLEDB.12.0;" +
                                    "Data Source=" + archivoExcel + ";" +
                                    "Extended Properties='Excel 12.0;HDR=YES;'";


OleDbConnection       connexcel        = new OleDbConnection(conneStringInraSIS);
connexcel.Open();        
</code></pre>
