Click here to Skip to main content
15,887,214 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
hi friends

I have tried in google for my problem with hour and hour. but i am not able to solve my problem.

first:
I am using
1)windows 8(64 bit) 2)visual studio 2010 (X86) 3) sql server 2008 (64 bit) 4)Ms office (32 bit).

I installed Accessdatabaseengine (32 bit) because i cannot able to install 64 bit.

My Error is
OLE DB provider 'Microsoft.ACE.OLEDB.12.0' cannot be used for distributed queries because the provider is configured to run in single-threaded apartment mode.



also i change the following in sq server

exec sp_configure 'show advanced options', 1
  reconfigure
  GO  
exec sp_configure 'Ad Hoc Distributed Queries', 1 
 reconfigure 
Posted
Comments
Sushil Mate 24-Jul-13 4:33am    
whats the issue exactly? you cant install 64bit or you cant export excel to sql?
baskaran chellasamy 24-Jul-13 4:40am    
i cant install 64 bit databaseaccessengin 64 bit
Thanks7872 24-Jul-13 4:50am    
Use Reply button[like i did by this comment] in order to let the one know about your comment.
Sushil Mate 24-Jul-13 4:54am    
how about installing the 64 bit MS office. then try installing the 64 bir database access engine?
Sushil Mate 24-Jul-13 5:41am    
below Guirec's solution is not working.

1 solution

You must firm-up the specs/scope of your problem:

if you want to import data from XL files within Sql Server using CSharp then :
you don't need MS Office
you don't need Accessdatabaseengine
and you should probably not use the OLE DB driver but the native sql server one...


To read your XL data:
use a library like (the excellent) ClosedXML[^]

Once the data is read you soimply do very classic Insert/Updates to your sql server table(s)
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900