使用Visual Studio连接到Oracle数据库 [英] Connecting to a Oracle database using Visual studio

查看:164
本文介绍了使用Visual Studio连接到Oracle数据库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有人给我一个.sln visual 2008项目,可以在我的Windows 7 64位计算机上运行.项目文件连接到oracle数据库并返回一些字符串.我有连接参数及其与System.Data.OracleClient一起使用.但是我的项目是x64,我无法使用Windows附带的System.Data.OracleClient.

我假设我需要从oracle网站安装一些东西.我不需要任何花哨的东西..只需连接数据库即可执行查询.我最低需要什么?我不想安装太大的东西.

我可以使用Instant Client还是需要其他诸如整个Oracle Database 11g发行版1或标准发行版之类的东西?

你能帮我吗?

下载并安装此文件后,我知道我必须定向tns.ora文件.我已经为Microsof.net System.Data.OracleClient完成了此操作.

我还需要什么?你能给我发指令,实现这一目标的基本程序吗?

谢谢
Jobin Thomas

Somebody gave me a .sln visual 2008 project to run on my windows 7 64 bit machine. The project file connects to a oracle database and returns some strings. I have the connection parameters and its working with System.Data.OracleClient. But my project is x64 and i cannot use the System.Data.OracleClient that comes with windows.

I am assuming I need to install something from oracle website. I don''t need anything fancy..just a basic connection to the database to execute my query. What do i need minimum? I dont want a big install.

Can I used Instant Client or do i need something else like the whole Oracle Database 11g Release 1 or something like the Standard Release?

Can you help me with this?

Once I have downloaded and installed this, i know i have to direct the tns.ora file. I already did this for Microsof.net System.Data.OracleClient.

What else do I need? Can you send me instructions, basic routine on achieving this?

Thanks
Jobin Thomas

推荐答案

由于Visual Studio是32位程序,因此无法与64位Oracle客户端一起使用.因此,您需要安装32位Oracle客户端并将项目设置为仅在调试项目时才编译为32位.

在项目的属性页中,选择编译"选项卡,然后单击高级编译选项".
对于目标CPU,选择"X86".

如果它是网站项目,则打开IIS管理器并选择项目使用的应用程序池,单击高级设置",然后将启用32位应用程序"设置为true.
As Visual studio is a 32-bit program, it won''t work with a 64 bit Oracle client. So you need to install a 32-bit Oracle client and set your project to compile to 32 bits only when debugging the project.

In the properties page for your project, select the compile tab and click the "Advanced Compile Options".
For Target CPU select "X86".

If it''s a website project, then open the IIS manager and select the application pool that your project uses, click "Advanced Settings" and set "Enable 32-bit Applications" to true.


安装64位Oracle客户端会有所帮助.如果您安装了仅32位版本,则如果它是64位编译的,则您的代码将无法使用.您不能在同一进程中混合使用32位和64位代码.
A 64-bit Oracle client installation would help. If you''ve installed the 32-bit only version, your code will not work with it if it is compiled 64-bit. You cannot mix 32-bit and 64-bit code in the same process.


这篇关于使用Visual Studio连接到Oracle数据库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆