I have been using the method to import excel data to my WPF application as mentioned in
Import Excel file into Microsoft SQL Server using C#
and
Reading Excel files from C#
it works great on debug mode but on release mode it dies!
The problem is my client has moved to x64 based machines and the application works fine but just that this piece of code is not working on x64 just because there is no more "Microsoft .Jet.OLEDB.4.0" drivers made available for x64 machines any more.
I dont want to use office interop or provide any dependency for the user to have office installed on the machines.
So any suggestion to avoid this?
Try using Microsoft.Ace.OLEDB.12.0 drivers instead
When we started upgrading all our machines, all my queries using Microsoft.Jet.OLEDB.4.0 stopped working and I had to upgrade them to use Microsoft.Ace.OLEDB.12.0. You shouldn't need to do anything other than change your connection string for it to work.
You could also try using the OpenXML SDK 2.0!
Here's an article that explains reading an excel file using the SDK: http://debugmode.net/2011/10/08/reading-excel-file-in-a-collection-using-open-xml-sdk-2-0/
Getting started and best practices: http://blogs.msdn.com/b/erikaehrli/archive/2009/05/14/open-xml-format-sdk-2-0-getting-started-best-practices.aspx
Hope this helps! ;)
I am using Aspose.cells library. It works pretty good and really easy to work. you can give it a try!
http://www.aspose.com/.net/excel-component.aspx
Related
I am working with MPLAB X which for those who don't know an IDE based on Netbeans. We are also using Git with continuous integration. I have now started to work in several different tests for our projects.
For example, MPLAB lets you choose which encoding you want to use in your projects and UTF-8 is not the default option so from time to time we would find problems opening the projects in different platforms. Now I test that every source code file is properly encoded.
We would also like to check code formatting and style. From what I've seen Netbeans comes with a tool to format code for you, but I don't see how to run this tool to print formatting mistakes as a test in our server. I have also seen that there are many tools like uncrustify that should be able to run in our server but they are not integrated with our IDE.
I would prefer not to maintain two different configuration files for this task, for this reason I am asking if anybody knows if there is a tool that can be run both in a Linux based server and that can be integrated with Netbeans for this task.
I am thinking of using vb.net and fetch data from a cnc controller (FANUC) which has FOCAS libraries, it supports vb.net. Please let me know how to get the data from it and store it in a database wamp server
(Sorry my example is for the 32bit implementation, but the 64 bit should parallel it)
Please take a look at your Fanuc Focus API CD.
You should find a directory like this:
\Fanuc Focas2 Drivers & Libraries V4.20\Fwlib\Dot NET sample
In that directory there will be the file:
fwlib32.vb
Add this file to your project. It will define all the possible function imports that you can use in Focas (Later you can trip this down of course, but to get started learning this, just use this file)
Please check the MTConnect adapter and the Fanuc-MTConnect-Agent.
After you got data by the adapter, you could use vb.net to do the next.
Fanuc adapter in cpp:
https://github.com/mtconnect/adapter/tree/master/fanuc
you can find the compiled Fanuc adapter here:
https://www.trakhound.com/downloads [MTConnect Agent for Fanuc]
and open source hosted on GitHub for MTConnect Agent for Fanuc:
https://github.com/TrakHound/Fanuc-MTConnect-Agent
I want to create two applications running on the same device (windows rt).
One application would be the app for inputting strings (example is string "235").
The second application would be the output for the first application. (showing "235").
Is it possible to do this in visual studio?
Yes this is possible to do in Visual Studio and to run on a development machine using the loopback adapter, however the loopback adapter is disabled for release builds. You can use the share contract to share your content as a custom object that only your intended application knows how to consume as a share target to accomplish this. A little more about your scenario is needed to provide proper guidance.
John Wiese
Microsoft - Sr. Technical Evangelist
jwiese#microsoft.com
#johnwiese
Try using DLL files.
More info: https://support.microsoft.com/kb/815065
I recently inherited a C# Winforms application that communicates with Quickbooks via their QBFC interface. The application contains a reference to the COM Server Interop.QBFC7.dll. The application works fine in our test environment and in several of our client's environments. Although, yesterday when I attempted to install it on a new customer's system I continued to get the following error:
Could Not Load File or Assembly 'Interop.QBFC, Version=8.0.0.87, Culture=neutral, PublicKeyToken=...' or one of its dependencies. The system cannot find the file specified.
I know that we have several customers running this application on various versions of Quickbooks (i.e. Quickbooks Pro, Premier and Enterprise between 2008 and Enterprise 11.0). To my knowledge, this is the first customer that we have attempted to deploy this application that has Enterprise 12.0.
I have attempted the following to resolve the issue with no success:
1) Install the QBFC7_Installer from the Intuit Developer Network Site
2) Install the Quickbooks SDK 10 Installer from the Intuit Developer Network Site
3) Verified that the Interop.QBFC7.dll file is present on the file system.
4) Attempted to manually register the COM object Interop.QBFC7.dll via the command prompt: regsvr32 Interop.QBFC7.dll (This fails as well and windows returns an error stating that it cannot find the object).
Does anyone have any suggestions or feedback about additional things that I can try to resolve this issue? I get the same error on 3 different machines at their site running different operating systems (i.e. Windows Server 2008, Windows 7, and Windows Vista)? I have also tried compiling in both x86 and 64-bit configurations to no avail.
Thanks in advance for any help.
First of all, you should be targeting an x86 build only. The QuickBooks SDK won't work if you target Any CPU or x64. Your main problem, though, is that you are looking for the wrong version of QBFC. Notice the version stamp on your error message:
Could Not Load File or Assembly 'Interop.QBFC, Version=8.0.0.87,
Culture=neutral, PublicKeyToken=...' or one of its dependencies. The
system cannot find the file specified
This is QBFC8, not QBFC7. So you should be able to fix the problem with the QBFC8 installer.
The version of QuickBooks should not make a difference, since QBFC 8 (or 7, for that matter) will work with the 2008 and Enterprise 11 or 12.
You should look into using a setup project to install your application in order to avoid this problem in the future. A setup project should detect the QBFC dependency automatically. Once you see this happening, go to SearchPath property of your setup project and add the MergeModule directory from the SDK that is installed on your machine. Once you do this, you should see that the QBFC and Xerces merge modules are added to your project automatically as dependencies. Of course, you'll also need to update your code to a more recent version of QBFC, but that's probably a good idea in any case.
I coded this thing up in VS2010, it worked fine. I needed to port it to VS2008, which went smoothly, aside from fixing how a few lines were worded. But it won't run, and my error codes say it's in opening this database.
com = New OleDbConnection(DB_Path)
com.Open()
With a string at the top defining DB_Path
Public Const DB_Path As String = "Provider=Microsoft.Jet.OleDb.4.0;Data Source=.\ASPNetDB.mdb"
Those two lines of code at the only thing in a Try statement, so they're the only thing that could be going wrong here. And yes, I made sure to copy the database into the new directory. I even tried using the full direct path in there and that didn't work either.
So what have I missed?
On a 64bit machine in VS2008 you need to set the target CPU to 32bit in the project properties, no 64 bit DLL exist for database access. I hope this helps
Just a guess-- but you may have to use a different Jet provider (not 4.0) in VS 2008, since it will be targeting an earlier release of .Net.