惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Attack and Defense Labs
Attack and Defense Labs
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
T
Threatpost
Project Zero
Project Zero
Know Your Adversary
Know Your Adversary
T
The Exploit Database - CXSecurity.com
P
Palo Alto Networks Blog
T
Tenable Blog
Scott Helme
Scott Helme
T
Tor Project blog
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
NISL@THU
NISL@THU
Cisco Talos Blog
Cisco Talos Blog
Security Latest
Security Latest
Simon Willison's Weblog
Simon Willison's Weblog
S
Securelist
Help Net Security
Help Net Security
Google DeepMind News
Google DeepMind News
Cloudbric
Cloudbric
C
Check Point Blog
Jina AI
Jina AI
Webroot Blog
Webroot Blog
量子位
博客园 - 三生石上(FineUI控件)
小众软件
小众软件
P
Privacy & Cybersecurity Law Blog
罗磊的独立博客
H
Heimdal Security Blog
C
CXSECURITY Database RSS Feed - CXSecurity.com
人人都是产品经理
人人都是产品经理
N
News and Events Feed by Topic
www.infosecurity-magazine.com
www.infosecurity-magazine.com
宝玉的分享
宝玉的分享
Hacker News - Newest:
Hacker News - Newest: "LLM"
L
LINUX DO - 热门话题
The GitHub Blog
The GitHub Blog
T
Troy Hunt's Blog
PCI Perspectives
PCI Perspectives
Vercel News
Vercel News
N
News | PayPal Newsroom
A
Arctic Wolf
T
The Blog of Author Tim Ferriss
博客园 - 司徒正美
博客园 - 叶小钗
Y
Y Combinator Blog
V
V2EX
美团技术团队
O
OpenAI News
Microsoft Security Blog
Microsoft Security Blog
AWS News Blog
AWS News Blog

博客园 - Ant

ASP.NET Core 项目简单实现身份验证及鉴权 使用iconfont图标 IIS调试ASP.NET Core项目 配置GitHub的SSH key Visual Studio Code 如何将新项目发布到GIT服务器 Xamarin踩坑经历 Abp项目中的领域模型实体类访问仓储的方法 在Abp中集成Swagger UI功能 发布以NLog作为日记工具的ASP.NET站点到IIS注意事项 Android Studio 简介及导入 jar 包和第三方开源库方[转] 解决jquery-ui-autocomplete选择列表被Bootstrap模态窗遮挡的问题 ORACLE存储过程创建失败,如何查看其原因 EF6配合MySQL或MSSQL(CodeFirst模式)配置指引 火狐通行证升级为Firefox Sync后,如何在多设备间同步书签等信息 (原创)通用查询实现方案(可用于DDD)[附源码] -- 设计思路 (原创)通用查询实现方案(可用于DDD)[附源码] -- 简介 利用Lambda获取属性名称 Entity Framework 6.0 源码解读笔记(一) [转]Sql server2005中如何格式化时间日期
Visual Studio连接Oracle数据库
Ant · 2017-04-18 · via 博客园 - Ant

一、安装Oracle Developer Tools for Visual Studio 2015

  其他的什么client一概不要装,装了的直接卸载。

  下载时需要登录,如果之前已经注册账号,提醒一下密码规则是需要同时包含大小写字母和数字的。

二、修改tnsnames.ora文件配置数据库服务器

  该文件位于安装目录\network\admin目录中,一般只需修改4个地方:服务别名、主机名(或IP)、端口号、服务名(一般为ORCL)

三、为.NET项目添加程序集引用

  打开VS2015会发现工具菜单里面多了一些与Oracle相关的项目,不过,这不是重点,而且VS2017里面不会有这些菜单项,但是无影响。

  新建或打开一个项目,在引用上点击右键添加引用,在弹出的对话框中选择"程序集"\"扩展",在搜索框输入oracle,选择Oracle.ManageDataAccess后确定。

四、编写测试代码

using System;
using Oracle.ManagedDataAccess.Client; //引用OracleConnection类所在的命名空间

namespace OracleDemo
{
    static class Program
    {
        static void Main()
        {
            using (var connection = new OracleConnection("Data Source=test;Persist Security Info=True;User ID=user;Password=123456;"))
            {
                connection.Open();
                Console.WriteLine("连接成功!!!");
            }
            Console.ReadLine();
        }
    }
}

 五、部署到IIS服务器

  以这种方式编写的访问Oracle的程序,在服务器上也同样需要安装Oracle Developer Tools for Visual Studio 2015并配置数据源,尽管服务器上不会安装Visual Studio,但毫无影响。

  PS:尝试了在服务器上安装传统的Oracle client,并通过Net Manager配置了服务,但是并不能访问到数据库。