Archive for July, 2010

A shift from IE to FF to GC

I have been using and favouring Internet Explorer for quite some time until mid of 2008 when I switched my job. Here I became a fan of FF instantly due to speed and features like firebug and other cheesy extensions. But recently I recognized a great down fall in firefox performance, not for me only my fellows are also encountering a heavy memory consumption by FF. Today I have made another move yes I have decided to make Google Chrome my default browser, but I will be back to FF if I feel improvements in the 4.0 which is in beta mode right now. The features introduced seems great and hope they will attract and make  customers  to :)

More about FF 4.0 beta here: http://www.mozilla.com/en-US/firefox/beta/features/

Working with Excel files using c#

During my current project I had some work of reading and writing from an Excel file.  I simply started with a Google Search :) and found many solutions, but the one provided by David Hayden was excellent Read Here.  Here I wont describe this article as its already really good, I will discuss the problem encountered in using this instead.

One major problem was to read the Excel spreadsheet at first place, David has used a connection string somewhat like:

string connectionString = @”Provider=Microsoft.Jet.
OLEDB.4.0;Data Source=Book1.xls;Extended
Properties=”"Excel 8.0;HDR=YES;”"”;

I was trying to read from an Office 2007 excel file and exceptions were encountered due to the above connection string. so I changed it to :

string connectionString = String.Format(@”Provider=Microsoft.ACE.OLEDB.12.0;Data Source={0};Extended Properties=”"Excel 12.0;HDR=YES;”"”, this.FilePath);

where this.FilePath contains the full path of the excel file.

Changing the conn string worked like a charm and everything is working fine now.

Enhanced by Zemanta