当前位置: 首页>>代码示例>>C#>>正文


C# DataBaseType类代码示例

本文整理汇总了C#中DataBaseType的典型用法代码示例。如果您正苦于以下问题:C# DataBaseType类的具体用法?C# DataBaseType怎么用?C# DataBaseType使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


DataBaseType类属于命名空间,在下文中一共展示了DataBaseType类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: ContextConnection

 /// <summary>
 /// 上下文初始化器(只赋值,不初始化,有可能被重复创建两次)
 /// </summary>
 /// <param name="connectionString">连接字符串</param>
 /// <param name="dbType">数据库类型</param>
 /// <param name="commandTimeout">命令超时时间</param>
 /// <param name="dataVer">数据库版本</param>
 public ContextConnection(string connectionString, DataBaseType dbType, int commandTimeout, string dataVer)
 {
     this.ConnectionString = connectionString;
     this.DbType = dbType;
     this.CommandTimeout = commandTimeout;
     this.DataVer = dataVer;
 }
开发者ID:SaintLoong,项目名称:Farseer.Net,代码行数:14,代码来源:ContextConnection.cs

示例2: DBHelper

 public DBHelper(ConnectionType conncetionType, DataBaseType DBMSType,string strDBFileNamePath)
 {
     DbConnectionType = conncetionType;
     dbType = DBMSType;
     S_DBFILENAME = strDBFileNamePath;
     oFactory = DbProviderFactories.GetFactory(RetreiveConnectionString());
 }
开发者ID:shreykejriwal,项目名称:insta,代码行数:7,代码来源:DBHelper.cs

示例3: PlotVarDB_Load

 private void PlotVarDB_Load(object sender, EventArgs e)
 {
     database = new DataBaseType();
     database.ME1 = new List<PlotVarEntry>();
     database.ME2 = new List<PlotVarEntry>();
     database.ME3 = new List<PlotVarEntry>();
 }
开发者ID:CreeperLava,项目名称:ME3Explorer,代码行数:7,代码来源:PlotVarDB.cs

示例4: DBAccess

        public DBAccess(DataBaseType dbType,string connectionString)
        {
            this._dbType = dbType;
            this._connectionString = connectionString;

            this.dbAccess= new DataBaseAccess(this._dbType, this._connectionString);
        }
开发者ID:AntonWong,项目名称:cms,代码行数:7,代码来源:DBAccess.cs

示例5: ContextAttribute

 /// <summary>
 ///     默认第一个数据库配置
 /// </summary>
 /// <param name="connectionString">数据库连接字符串</param>
 /// <param name="dbType">数据库类型</param>
 /// <param name="dataVer">数据库版本</param>
 /// <param name="commandTimeout">SQL执行超时时间</param>
 public ContextAttribute(string connectionString, DataBaseType dbType = DataBaseType.SqlServer, string dataVer = "2008", int commandTimeout = 30)
 {
     ConnStr = connectionString;
     DataType = dbType;
     DataVer = dataVer;
     CommandTimeout = commandTimeout;
 }
开发者ID:lirongjun0926,项目名称:Farseer.Net,代码行数:14,代码来源:ContextAttribute.cs

示例6: GetConnectionString

        public static ConnectionString GetConnectionString(string connectionString, DataBaseType type)
        {
            var values = connectionString.Split((";").ToCharArray(), StringSplitOptions.RemoveEmptyEntries);

            var eConnectionString = new ConnectionString();

            eConnectionString.String = connectionString;
            eConnectionString.Type = type;

            switch (eConnectionString.Type)
            {
                case DataBaseType.SqlServer:
                    eConnectionString.Server = values[0].Split('=')[1];
                    eConnectionString.DataSource = values[1].Split('=')[1];
                    eConnectionString.User = values[2].Split('=')[1];
                    eConnectionString.Password = values[3].Split('=')[1];
                    break;
                case DataBaseType.Oracle:
                    eConnectionString.DataSource = values[0].Split('=')[1];
                    eConnectionString.User = values[1].Split('=')[1];
                    eConnectionString.Password = values[2].Split('=')[1];
                    break;
            }

            return eConnectionString;
        }
开发者ID:EliandroLA,项目名称:Front,代码行数:26,代码来源:Utilities.cs

示例7: GetDatabaseCountQuery

        public string GetDatabaseCountQuery(DataBaseType dbType)
        {
            if (dbType == DataBaseType.Mssql)
            return "SELECT LTRIM(STR(COUNT(name))) FROM master..sysdatabases";

             return "SELECT COUNT(schema_name) FROM information_schema.SCHEMATA";
        }
开发者ID:mcorrientes,项目名称:Web-Security-Toolset,代码行数:7,代码来源:QueryConstructor.cs

示例8: GetFunctionExtractObjectsArgs

        private ExtractObjectsArgs GetFunctionExtractObjectsArgs(DataBaseType dbType)
        {
            switch (dbType)
            {
                case DataBaseType.Oracle:
                    return new ExtractObjectsArgs(
                        Settings.Oracle.Function.Default.Regex,
                        _inputText,
                        Settings.Oracle.Function.Default.DropEnding,
                        Settings.Oracle.Function.Default.DropReplace,
                        Settings.Oracle.Function.Default.CreateEnding,
                        Settings.Oracle.Function.Default.CreateSearch,
                        Settings.Oracle.Function.Default.CreateReplace,
                        _functions,
                        delegate(string str) { return str.Equals("\r\nBEGIN\r\nRETURN NULL;\r\n"); });

                case DataBaseType.SQLServer:
                    return new ExtractObjectsArgs(
                        Settings.SQLServer.Function.Default.Regex,
                        _inputText,
                        Settings.SQLServer.Function.Default.DropEnding,
                        Settings.SQLServer.Function.Default.DropReplace,
                        Settings.SQLServer.Function.Default.CreateEnding,
                        Settings.SQLServer.Function.Default.CreateSearch,
                        Settings.SQLServer.Function.Default.CreateReplace,
                        _functions,
                        delegate(string str) { return str.Equals(" begin\r\nreturn NULL\r\n"); });

                default:
                    throw new NotSupportedException(
                        String.Format("{0} is not a valid DataBase Type!",
                        (DataBaseType)dbType));
            }
        }
开发者ID:wedoit-io,项目名称:ExportSQL,代码行数:34,代码来源:DBTypeManagement.cs

示例9: CreateDataBase

        public bool CreateDataBase(DataBaseType nType, string nConnectionString, byte[] nRemotingPassword, out DataBase nDataBase, out string nMessage)
        {
            nMessage = "";
            nDataBase = null;

            try
            {
                if (this.ServerPassword == Crypto.RSADecryptText(nRemotingPassword, this.ServerPrivateKey))
                {
                    nDataBase = DataBaseFactory.CreateDatabase(nType, DataBaseFactory.GetInnerConnectionString(nConnectionString));

                    nDataBase._proxy = this;

                    this._DataBaseList.Add(nDataBase._token, nDataBase);

                    return true;
                }
                else
                {
                    throw new Exception("La contraseña de acceso al servidor remoting no es válida");
                }
            }
            catch (Exception ex)
            {
                nMessage = ex.Message;
            }

            return false;
        }
开发者ID:jcrajat,项目名称:DAL_Design,代码行数:29,代码来源:DataBaseProxy.cs

示例10: GetDatarowsCount

        public string GetDatarowsCount(string databaseName, string tableName, DataBaseType dbType)
        {
            if (dbType == DataBaseType.Mssql)
            return "SELECT LTRIM(STR(COUNT(*))) FROM " + databaseName + ".." + tableName + "";

             return "SELECT COUNT(*) FROM " + databaseName + "." + tableName;
        }
开发者ID:mcorrientes,项目名称:Web-Security-Toolset,代码行数:7,代码来源:QueryConstructor.cs

示例11: DbGetVersion

        public string DbGetVersion(DataBaseType dbType)
        {
            if (dbType == DataBaseType.Mssql)
            return "@@VERSION";

             return "VERSION()";
        }
开发者ID:mcorrientes,项目名称:Web-Security-Toolset,代码行数:7,代码来源:QueryConstructor.cs

示例12: DbGetUser

        public string DbGetUser(DataBaseType dbType)
        {
            if (dbType == DataBaseType.Mssql)
            return "SYSTEM_USER";

             return "CURRENT_USER()";
        }
开发者ID:mcorrientes,项目名称:Web-Security-Toolset,代码行数:7,代码来源:QueryConstructor.cs

示例13: DbGetDatabase

        public string DbGetDatabase(DataBaseType dbType)
        {
            if (dbType == DataBaseType.Mssql)
            return "DB_NAME()";

             return "DATABASE()";
        }
开发者ID:mcorrientes,项目名称:Web-Security-Toolset,代码行数:7,代码来源:QueryConstructor.cs

示例14: GetDataBase

 /// <summary>
 /// 返回数据库操作
 /// </summary>
 /// <param name="databaseName">数据库名称</param>
 /// <param name="dbType">数据库类型</param>
 /// <returns>返回数据库</returns>
 internal static Database GetDataBase(string databaseName,DataBaseType dbType)
 {
     if(dbType == DataBaseType.Write)
      {
          return  DatabaseFactory.GetWriteDatabase(databaseName);
      }
      return  DatabaseFactory.GetReadDatabase(databaseName);
 }
开发者ID:TCTeam,项目名称:JQEBookingTest,代码行数:14,代码来源:DatabaseManager.cs

示例15: DbExecutor

        /// <summary>
        ///     构造函数
        /// </summary>
        /// <param name="dbType">数据库类型</param>
        /// <param name="connectionString">数据库连接字符串</param>
        /// <param name="commandTimeout">数据库执行时间,单位秒</param>
        /// <param name="tranLevel">开启事务等级</param>
        public DbExecutor(string connectionString, DataBaseType dbType = DataBaseType.SqlServer, int commandTimeout = 30, IsolationLevel tranLevel = IsolationLevel.Unspecified)
        {
            _connectionString = connectionString;
            _commandTimeout = commandTimeout;
            DataType = dbType;

            OpenTran(tranLevel);
        }
开发者ID:lirongjun0926,项目名称:Farseer.Net,代码行数:15,代码来源:DbExecutor.cs


注:本文中的DataBaseType类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。