C#连接orcle数据库
来源:互联网 发布:电脑看书软件阅读器 编辑:程序博客网 时间:2024/05/01 21:29
using System;
using System.Collections.Generic;
using System.Text;
using System.Data.OracleClient;
using System.Data;
namespace Common
{
public class DataAccess
{
private string _connectionStr = " ";
private string _userID = " ";
private OracleConnection _conn = null;
private OracleCommand _comm = null;
private OracleDataAdapter _da = null;
public DataAccess(string dataSource,string userID,string password)
{
this._userID = userID;
this._connectionStr = "data source= "+dataSource+ ";user id= "+userID+ ";password= "+password+ "; ";
this._conn = new OracleConnection(this._connectionStr);
this._comm = new OracleCommand();
this._comm.CommandType = CommandType.Text;
this._comm.Connection = this._conn;
this._da = new OracleDataAdapter();
this._da.SelectCommand = this._comm;
}
/// <summary>
/// 关闭数据库连接
/// </summary>
public void Close()
{
this._conn.Close();
}
/// <summary>
/// 验证用户登陆是否成功
/// </summary>
/// <returns> </returns>
public bool Login()
{
bool returnValue = true;
try
{
this._conn.Open();
}
catch
{
returnValue = false;
}
finally
{
if (this._conn.State == ConnectionState.Open)
{
this._conn.Close();
}
}
return returnValue;
}
}
}
- C#连接orcle数据库
- C#窗体连接Orcle数据库的问题
- pl/sql连接远程orcle数据库
- 【原创】远程连接Orcle 10g数据库
- [orcle]远程连接数据库错误分析
- asp.net 连接orcle 数据库实例
- orcle数据库
- 远程连接服务器ORCLE
- Plsql orcle 远程连接
- orcle数据库启动验证
- QT Orcle数据库操作
- ORClE数据库实验 —
- SQL SERVER 2000 连接ORCLE数据库 (加了一个存储过程的实例)
- ODBC与ORCLE的连接及并导出数据库数据到Excel
- Java使用JDBC连接mysql、sqlserver、orcle数据库的baseDao类
- c#操作的orcle数据库以及dataReader与datagridview的捆绑
- orcle数据库操作相关脚本
- ORCLE 数据库截取小方式
- 多态性
- Regex 替换,无分隔符
- Ubuntu could not write bytes: broken pipe开机出现
- 自制数字软盘
- 注解@PostConstruct与@PreDestroy
- C#连接orcle数据库
- Stooge sort: Sorting by Exchanging
- 窗口,控件:捕捉焦点
- PHP高级程序设计——抽象类
- UItableView 的使用总结
- 链表自定义队列
- hdu5527Too Rich
- 懒加载
- c#写事物