c# - Trying to connect to excel 2010 doesn't work -
I found this exception: 'Microsoft.ACE.OLEDB.12.0' provider is not registered on the local machine.
I was trying to add Excel 2010 files with OleDBConnection. I have Windows 7 64bit and Office 2010 32bit.
I have tried to redistribute Microsoft Access Database Engine 2010, which gives the following suggestions:
I also suggested:
any of them Does not work for me anybody can help?
Here is my code: String Connection String = "Provider = Microsoft.ACE.OLEDB.12.0; Data Source = D: \ Sample .xlsx; Mode = Share Disclaimer; Expanded Properties = \" HDR = Yes; \ "; Jet ALLDB: Engine Type = 37"; There is a discussion about this error, please see it and tell me if This has worked for you. Best Relationship Try setting it first: Try the following method: Note: This office works for 2010 even if it is for the 2007 office Download and install it: OLEDBox Connection = New OddBack Connection (Connection String); Try {connection.Open (); ODDB Commands Command = new OLEDB Commands ("SELECT * FROM [Sheet 1 $]", Connection); OleDbDataAdapter Adapter = New OleDbDataAdapter (); Adapter.SelectCommand = Order; Dataset ds = new dataset (); Adapter.fill (ds); Ds.Tables [0] .Rows.Count.Dump (); } Hold (exception) {throw; } Finally {connection.Close (); }
Comments
Post a Comment