lunes, 27 de junio de 2011

Excell y OleDB, External table is not in the expected format

Si el archivo de origen tiene el formato Excel 2007/2010 entonces el provider correcto debe siempre ser: Microsoft.ACE.OLEDB.12.0.

Adicionalmente no olvidar que la extension NO es xls SINO xlsx

Ejemplo:
public static string path = @"C:\Test\Test.xlsx";

public static string stCon = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=" + path + ";Extended Properties=Excel 12.0;";

1 comentario: