Archive for February, 2014

My initialization string is non-conforming

I was importing data from Excel when I received this message:

System.ArgumentException: Format of the initialization string does no conform to specification starting at index 144.

This was caused by a bad quote. Not a bad quote as in something from Napoleon Dynamite. No, a bad quote as in an incorrect quotation mark. Take this connection string snippet that I copied from a previous blog post:

Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\Users\scott.stoecker\Documents\Frogs.xlsx;Extended Properties=”Excel 12.0 xml; IMEX=1; HDR=Yes;”

Word Press had formatted the quotation marks from the normal ones we see in Visual Studio or the VCC Manager (“) to the fancy kind approved by poets in turtlenecks hanging out in coffee shops (”). Changing the quotation mark to the boring old kind fixed the problem.

Leave a comment