Development environment:
Os:⑥4 bit Win7
Development tools: VS2010
Database: Oracle11gr1 (⑥ 4-bit 澲 service end, 32-bit client)
VS2010 error message: The data connection is unsuccessful, please check 澲 to see if the database has started when attempting to load an Oracle client, the BadImageFormatException is raised. This problem occurs if the 32-bit Oracle client component is installed to run in ⑥ 4-bit mode.
Reference to this article, but did not solve the problem, do not know what the reason. But also do a collect zàng, perhaps later can use.
Http://www.cnвlogs.com/creator/archive/2010/11/26/1885657.html
Study of the afternoon, did not fix, finally sǐ horse when live horse medicine, unexpectedly try success, at that time feeling really "no way, Liu Dark Huā Ming another village." The solution fǎ is simple: Continue with the original installed 32-bit instantclient, environment variable path, add "C:\Oracle\product\instantclient_11_2" at the front ; (This is my local 32-bit instantclient directory), after confirmation, reboot , fix. Note that the environment variable must be at the front, at least in Oracle-related path, which should be placed at the front, or it may detect the ⑥ 4-bit directory first, and the program continues to complain.
Learning without thinking is useless, this rookie probably analyze the reason: vs2010 debugging tool WebDev.WebServer20.exe is 32-bit, need to execute the corresponding 32-bit Oracle client program, the most critical is oci.dll. and the original PATH environment variable Oracle Service 澲 server directory, which is the ⑥ 4-bit program, packet hán6*4 bit oci.dll, at this time vs call 6*4 bit dynamic library, execution error. We simply allow vs to detect 32-bit oci.dll, pass 澲 Modify the environment variable path to achieve. After comparison, this machine installed Oracle Service 澲 and client, inside the two oci.dll file size is different, also verified my guess.