Conris.Utility/DbHelperOleDb.cs

(开头部分) 17KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

using System;
using System.Collections;
using System.Collections.Specialized;
using System.Data;
using System.Data.OleDb;
using System.Configuration;

namespace Conris.Utility
{
    /// <summary>
    /// 数据访问基础类(基于OleDb) 
    /// 可以用户可以修改满足自己房源的需要。
    /// Copyright (C) Maticsoft
    /// </summary>
    public abstract class DbHelperOleDb
    {
        //数据库连接字符串(web.config来配置),可以动态更改connectionString支持多数据库.		
        public static string connectionString = Conris.Utility.ConfigHelper.GetConfigString("ConnectionString");
        //public static string connectionString = "Provider=MSDAORA.1;User ID=ISMS_User;password=Conris1885;Data Source=ORCL;Persist Security Info=False";
        public DbHelperOleDb()
        {
        }


        #region 公用方法

        public static int GetMaxID(string FieldName, string TableName)
        {
            string strsql = "select max(" + FieldName + ")+1 from " + TableName;
            object obj = DbHelperOleDb.GetSingle(strsql);
            if (obj == null)
            {
                return 1;
            }
            else
            {
                return int.Parse(obj.ToString());
            }
        }
        public static bool Exists(string strSql)
        {
            object obj = DbHelperOleDb.GetSingle(strSql);
            int cmdresult;
            if ((Object.Equals(obj, null)) || (Object.Equals(obj, System.DBNull.Value)))
            {
                cmdresult = 0;
            }
            else
            {
                cmdresult = int.Parse(obj.ToString());
            }
            if (cmdresult == 0)
            {
                return false;
            }
            else
            {
                return true;
            }
        }
后面还有 428 行代码,购买后查看完整代码

24 小时内免费解锁 3 个项目,之后 1 积分/个。 规则说明

AI 解读

登录后可用,每次 10 积分,解读结果公开显示在下面。

还没有人解读过这个文件。