.Net 连接Oracle 数据库写法
2014-01-24 10:12
387 查看
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using Oracle.DataAccess.Client;
namespace OracleDataAccess
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
OracleConnection connection = new OracleConnection("Data Source=orcl;User ID=uqbuy;Password=root");
connection.Open();
OracleCommand cmd = new OracleCommand("select * from test") { Connection = connection, ArrayBindCount = 10 };
OracleDataAdapter adapter = new OracleDataAdapter(cmd);
DataTable dt = new DataTable();
adapter.Fill(dt);
connection.Close();
}
}
}
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using Oracle.DataAccess.Client;
namespace OracleDataAccess
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
OracleConnection connection = new OracleConnection("Data Source=orcl;User ID=uqbuy;Password=root");
connection.Open();
OracleCommand cmd = new OracleCommand("select * from test") { Connection = connection, ArrayBindCount = 10 };
OracleDataAdapter adapter = new OracleDataAdapter(cmd);
DataTable dt = new DataTable();
adapter.Fill(dt);
connection.Close();
}
}
}
相关文章推荐
- .net 连接ORACLE 数据库
- 在 oracle 数据库上构建 .NET程序以及数据库连接事务说明
- 用oralce连接.net客户端出现问题:“数据连接不成功,请检查该数据库是否已启动尝试加载oracle客户端时引发BadImageFormatException.如果在安装32位Oracle客户端组件的情况下以64位模式运行,”的解决办法
- .net开发连接Oracle数据库注意问题
- .net 程序远程连接 Oracle 数据库
- .net 连接ORACLE 数据库的例子
- 转载:用oralce连接.net客户端出现问题:“数据连接不成功,请检查该数据库是否已启动尝试加载oracle客户端时引发BadImageFormatException.如果在安装32位Oracle客户端组件的情况下以64位模式运行,”的解
- .net 连接ORACLE 数据库字符串
- .net 连接 SAP后台数据库(AIX+oracle)
- .Net与Oracle的数据库连接
- .net程序无法连接oracle9.2.0.1数据库解决方法
- .NET跨平台之旅:数据库连接字符串写法引发的问题
- 用oralce连接.net客户端出现问题:“数据连接不成功,请检查该数据库是否已启动尝试加载oracle客户端时引发BadImageFormatException.如果在安装32位Oracle客户端组
- .net连接oracle 预编译写法
- java JDBC连接不同的数据库写法sql,oracle,mysql
- .net 连接ORACLE 数据库的例子
- oracle连接数据库
- oracle客户端不需要配置tnsnames.ora文件直接连接服务器数据库
- 数据库编程2 Oracle 过滤 函数 分组 外连接 自连接
- JDBC连接数据库使用SERVICE NAME、SID以及TNSName不同写法