bonjour,
j'ai essayer pour les fichiers excel voici ce que j'ai pu faire
string ConnectionString = "Driver={Microsoft Excel Driver (*.xls)};DriverId=790;Dbq=D:\\ched\\fichiers marchants\\pixmania.csv;DefaultDir=c:\";
string CommandText = "select * from pixmania.csv";
OdbcConnection myConnection =
new OdbcConnection(ConnectionString);
OdbcCommand myCommand =
new OdbcCommand(CommandText, myConnection);
myConnection.Open();
DataGrid1.DataSource = myCommand.ExecuteReader(CommandBehavior.CloseConnection);
DataGrid1.DataBind();
myConnection.Close();
et l'erreur est:
ERROR [HY000] [Microsoft][ODBC Excel Driver]General error Unable to open registry key 'Temporary (volatile) Jet DSN for process 0x5dc Thread 0x8ac DBC 0x439544 Excel'. ERROR [IM006] [Microsoft][ODBC Driver Manager] Driver's SQLSetConnectAttr failed ERROR [HY000] [Microsoft][ODBC Excel Driver]General error Unable to open registry key 'Temporary (volatile) Jet DSN for process 0x5dc Thread 0x8ac DBC 0x439544 Excel'. ERROR [HY000] [Microsoft][ODBC Excel Driver] External table is not in the expected format. ERROR [HY000] [Microsoft][ODBC Excel Driver]General error Unable to open registry key 'Temporary (volatile) Jet DSN for process 0x5dc Thread 0x8ac DBC 0x439544 Excel'. ERROR [HY000] [Microsoft][ODBC Excel Driver]General error Unable to open registry key 'Temporary (volatile) Jet DSN for process 0x5dc Thread 0x8ac DBC 0x439544 Excel'. ERROR [HY000] [Microsoft][ODBC Excel Driver] External table is not in the expected format.
<META content="Microsoft Visual Studio .NET 7.1" name=GENERATOR>
<META content=C# name=CODE_LANGUAGE>
<META content=JavaScript name=vs_defaultClientScript>
<META content=
http://schemas.microsoft.com/intellisense/ie5 name=vs_targetSchema>
pouvez voue m'aidez
Merci pour votre aide
Afficher la suite