0

I have DB2 server that I'm trying to connect from my machine, but I keep getting the below error when I start the application, before even start the connection

System.BadImageFormatException: 'Could not load file or assembly 'IBM.Data.DB2, Version=9.7.4.4, Culture=neutral, PublicKeyToken=7c307b91aa13d208' or one of its dependencies. An attempt was made to load a program with an incorrect format.'

please not that I don't have DB2 driver installed on my machine. but I refer to the below libraries in my application, which I got them from DB2 database server.

  • IBM.Data.DB2;
  • IBM.Data.DB2.Entity;
  • IBM.Data.Informix;
5
  • looks like you are missing some assemblies required for using your db2 provider client lib. you might wanna search what is missing and install the proper packages or runtimes. Commented Dec 30, 2019 at 9:05
  • How can I know what's the missing assemblies ? Commented Dec 30, 2019 at 9:07
  • By getting to know what are your runtime assemblies. a simple google search can help with that. Commented Dec 30, 2019 at 9:19
  • Those libraries need need a driver. You need to go into Admin tools and add an ODBC connection to the DB2 server. Commented Dec 30, 2019 at 9:58
  • I don't have DB2 option in ODBC Commented Dec 30, 2019 at 10:05

1 Answer 1

3

Normally the error message is caused by a 32/64 bit conflict.

Your program could be compiled in 64 bit (or any) and the drivers in 32 bit or the other way round.

Check the Configuration Manager and set the Platform to x86 or x64.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.