2024年5月4日发(作者:)
用
C#
来操作
ORACLE
数据库
using System;
using tions;
using lized;
using ;
using Client;
using uration;
namespace DAL //修改成实际项目的命名空间名称
{
///
/// Copyright (C) 2004-2008 LiTianPing
/// 数据访问基础类(基于Oracle)
/// 可以用户可以修改满足自己项目的需要。
///
public abstract class DbHelperOra
{
//数据库连接字符串(来配置)
// value="server=127.0.0.1;database=DATABASE;uid=sa;pwd=" /> protected static string connectionString = tings["ConnectionString"]; public DbHelperOra() { } #region 公用方法 public static int GetMaxID(string FieldName,string TableName) { string strsql = "select max(" + FieldName + ")+1 from " + TableName; object obj = GetSingle(strsql); if (obj == null) { return 1; } else { return (ng()); } } public static bool Exists(string strSql, params SqlParameter[] cmdParms) { object obj = GetSingle(strSql, cmdParms); int cmdresult; if (((obj, null)) || ((obj, ))) { cmdresult = 0; } else { cmdresult = (ng()); } if (cmdresult == 0) { return false; } else { return true; } } #endregion #region 执行简单SQL语句 /// /// 执行SQL语句,返回影响的记录数 /// /// SQL语句 /// public static int ExecuteSql(string SQLString) { using (OracleConnection connection = new
发布评论