error occured when i insert data into excel 2007 using C# ?

i create one C# window application , in that application i have insert data into excel from aspx page ,but when i try to insert data i got the following error in my connectionstring

The 'Microsoft.ACE.OLEDB.12.0' provider is not registered on the local machine.

what can i do to solve this error ??
Parth48Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

rockiroadsCommented:
is the driver definitely installed? I can't remember if its installed by default or an optional install. Do you still have your office cd handy?
Parth48Author Commented:
My connectionstring is listed below ...

<appSettings>
    <add key ="ExcelConnectionString" value="Provider=Microsoft.ACE.OLEDB.12.0;Data Source=E:\\Inventory.xlsx;Extended Properties=\Excel 12.0;HDR=Yes;IMEX=2\"/>
  </appSettings>

anything wrong in the above connectionstring or problem in other coding ..
please find the attachment of class file (General.cs)
General.cs
rockiroadsCommented:
Another thing, what platform are you running this on. Is it 64bit? Looks like driver might not be available
Have a read here for that plus a little more like the data connectivity components http://social.msdn.microsoft.com/Forums/en-US/vsto/thread/43d6b544-7172-4fe7-babf-a541e5f6a1c9
OWASP Proactive Controls

Learn the most important control and control categories that every architect and developer should include in their projects.

Parth48Author Commented:
yes i used Window 7 Home Edition (64 bit) , where i can download the data connectivity drivers for 64 bit ?
Parth48Author Commented:
yes i have the office 2007 CD ...
what can i do next ?
rockiroadsCommented:
Everything I read is 64bit drivers are not available yet. So you might find an issue here. Perhaps ask/check with microsoft.
MS Feedback link https://connect.microsoft.com/SQLServer/feedback/details/125117/need-64-bit-jet-provider-for-x64-box


A suggestion here is create via 32bit com interop

http://forums.asp.net/p/1128266/1781961.aspx

viralbhattCommented:
had similar problem and used following steps to solve it.

Basically, if you're on a 64-bit machine, IIS 7 is not (by default) serving 32-bit apps, which the database engine operates on. So here is exactly what you do:

1) ensure that the 2007 database engine is installed, this can be downloaded at: http://www.microsoft.com/downloads/details.aspx?FamilyID=7554F536-8C28-4598-9B72-EF94E038C891&displaylang=en

2) open IIS7 manager, and open the Application Pools area. On the right sidebar, you will see an option that says "Set application pool defaults". Click it, and a window will pop up with the options.

3) the second field down, which says 'Enable 32-bit applications' is probably set to FALSE by default. Simply click where it says 'false' to change it to 'true'.

4) Restart your app pool (you can do this by hitting RECYCLE instead of STOP then START, which will also work).

5) done, and your error message will go away.

do not forget to give me points.
rockiroadsCommented:
shubham, is jet compatable with office 2007? I didn't think it was.

So viral, if I wanted to develop a winform app, not using IIS, how does one solve this problem?
rockiroadsCommented:
connectionstrings.com gives a list of connections for ado/excel.

I do not think you can use Jet as shubham has suggested but your welcome to give it a try.

http://www.connectionstrings.com/excel#p84

Now these guys state that nothing is available for x64 http://www.connectionstrings.com/Articles/Show/using-jet-in-64-bit-environments

but then when you do look at the details for 64bit it states office 2010 has 64bit drivers

With the new Office 2010, there will be new drivers coming, "2010 Office System Driver", which will be provided as both 32-bit and 64-bit versions. You can use these drivers to let you application connect to Access, Excel and text-files in a 64 bit environment, utilizing the new 64 bit drivers. The provider name is "Microsoft.ACE.OLEDB.14.0". You don't need to buy or install the Office suite, the components are available as a separate download.

http://www.microsoft.com/downloads/en/details.aspx?FamilyID=C06B8369-60DD-4B64-A44B-84B371EDE16D&displaylang=en

So maybe you can give this a try and see how well that works for you. Your current connection string uses OLEDB 12.0 which is office 2007. You will probably have to change this to OLEDB 14.0.

Let us know if this works for you.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
rockiroadsCommented:
I take it back about the provider string. The MS article states this

2.If you are an application developer using OLEDB, set the Provider argument of the ConnectionString property to “Microsoft.ACE.OLEDB.12.0”
¿If you are connecting to Microsoft Office Excel data, add “Excel 14.0” to the Extended Properties of the OLEDB connection string.
Parth48Author Commented:
thanks to all of you for support ...
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
C#

From novice to tech pro — start learning today.