ConnectionSsortingng pour get un problème de file Excel

dans un file Excel nommé (a.xlsx) dans un dossier nommé (ExcelFiles).

Le dossier ExcelFiles se trouve dans la racine de mon projet.

donc ma string de connection pour get des données de file excel est comme ceci:

<add name="xlsx" connectionSsortingng="Provider=Microsoft.ACE.OLEDB.12.0;Data Source=aaa\ExcelFiles\a.xlsx;Extended Properties=Excel 12.0"/> 

aaa = Nom de mon projet

Avec cette string de connection, tout est correct dans le local, mais après le téléchargement du site Web, j'ai une erreur.

où est le problème??

ce path est-il vrai -> ~ / ExcelFiles / a.xlsx ou non

pouvez-vous réparer ce path 4 moi ….

Après avoir résolu le problème de path, l'erreur se présente comme suit:

  The 'Microsoft.ACE.OLEDB.12.0' provider is not registered on the local machine. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: System.InvalidOperationException: The 'Microsoft.ACE.OLEDB.12.0' provider is not registered on the local machine. Le fournisseur «Microsoft.ACE.OLEDB.12.0» n'est pas enregistré sur la machine locale.  The 'Microsoft.ACE.OLEDB.12.0' provider is not registered on the local machine. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: System.InvalidOperationException: The 'Microsoft.ACE.OLEDB.12.0' provider is not registered on the local machine. 

Comment puis-je faire avec cette erreur?

Merci à l'avance à venir

meilleures salutations

La machine sur laquelle vous hébergez le file n'a pas installé ACE OleDB pour le pilote de bureau. Je changerais le pilote JetOleDB

Une string de connection Jet OleDB ressemble à

 Provider=Microsoft.Jet.OLEDB.4.0;Data Source={0};Extended Properties="Excel 8.0;HDR=Yes;IMEX=1"; 

Excel8.0 est la version 2003, je crois. Pour 2007, vous voudrez utiliser Excel12.0

Donc, ce que je voulais, c'est faire un Ssortingng.Format et simplement passer l'location du file excel, bien sûr, car cela semble être une application asp.net, il devrait ressembler à quelque chose comme ceci:

 Ssortingng con = Ssortingng.Format( @"Provider=Microsoft.Jet.OLEDB.4.0;Data Source={0};Extended Properties="Excel 8.0;HDR=Yes;IMEX=1"", Server.MapPath(EXCEL FILE LOCATION) ); 

Vous pouvez bien sûr simplement mettre la string utilisée dans le Ssortingng.Format dans votre file de configuration de sorte qu'il n'est pas codé comme je l'ai.

Jetez un oeil à l'url suivante, il a des informations sur la façon de résoudre ce problème

http://www.microsoft.com/downloads/fr/details.aspx?FamilyID=7554F536-8C28-4598-9B72-EF94E038C891&displaylang=fr