DBUitily/DBSqlServer.cs

(开头部分) 10KB

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

using System;
using System.Collections.Generic;
using System.Text;
using System.Configuration;
using ORMAttributes;
using System.Data.SqlClient;
using System.Data;
using System.Collections;
using System.Reflection;

namespace DBUitily
{
    /// <summary>
    /// 作者:徐飞
    /// 创建时间:2013-10-25
    /// 最后一次修改时间:2013-10-30
    /// 备注:您可以将该框架使用在任何场所,但请保留著作信息,请尊重作者的劳动成果;保护知识产权
    /// <summary>
    public class DBSqlServer
    {
        private static string CONNECTION = ConfigurationManager.AppSettings["connection"].ToString();
        private static bool _ISCREATE;

        public static bool ISCREATE
        {
            get {
                try
                {
                    _ISCREATE = ConfigurationManager.AppSettings["auto"].ToString().Equals("1");
                }
                catch (Exception)
                {
                    _ISCREATE = true;
                }
                return DBSqlServer._ISCREATE; }
        }

        public static bool CreateTable<T>(Type t,ref TabelInfo ti)
        {
            //通过类型,获取名称,从缓存中读取
            //隐式创建缓存
            object[] obj = t.GetCustomAttributes(typeof(BindTableAttribute), false);
            foreach (BindTableAttribute item in obj)
            {
                if (item == null)
                    continue;
                string key = item.name;
                ti = ManageTabel._tabels[key] == null ? ti : ManageTabel._tabels[key];
            }
            if (ti == null)
            {
                throw new Exception("数据结构发生异常");
            }

            if (!ISCREATE)
                return true;

            //检查数据库中是否存在
            if (IsHaveTabel(ti))
            {
后面还有 250 行代码,解锁后查看完整代码

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

AI 解读

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

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