• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# DataBaseType类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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


示例16: GetDatabaseNameQuery

        public string GetDatabaseNameQuery(DataBaseType dbType, int dbIndex)
        {
            if (dbType == DataBaseType.Mssql)
            return "SELECT TOP 1 name FROM master..sysdatabases WHERE name NOT IN (SELECT TOP " + dbIndex +
                   " name FROM master..sysdatabases ORDER BY name)";

             return "SELECT schema_name FROM information_schema.SCHEMATA LIMIT " + dbIndex + ", 1";
        }
开发者ID:mcorrientes,项目名称:Web-Security-Toolset,代码行数:8,代码来源:QueryConstructor.cs


示例17: DbExecutor

        /// <summary>
        ///     构造函数
        /// </summary>
        /// <param name="dbType">数据库类型</param>
        /// <param name="connnection">数据库连接字符串</param>
        /// <param name="commandTimeout">数据库执行时间,单位秒</param>
        /// <param name="tranLevel">开启事务等级</param>
        public DbExecutor(DataBaseType dbType, string connnection, int commandTimeout, IsolationLevel tranLevel = IsolationLevel.Unspecified)
        {
            ConnectionString = connnection.Replace("|RootDirectory|", AppDomain.CurrentDomain.BaseDirectory, RegexOptions.IgnoreCase);
            CommandTimeout = commandTimeout;
            DataType = dbType;

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


示例18: Request

 public Request()
 {
     NaturalRequestNr = 0;
      URL = string.Empty;
      POST = string.Empty;
      HTML = string.Empty;
      DataBaseType = DataBaseType.Unknown;
      Function = string.Empty;
 }
开发者ID:mcorrientes,项目名称:Web-Security-Toolset,代码行数:9,代码来源:RequestManager.cs


示例19: InternalData

 public InternalData()
 {
     Prepared = false;
      ParameterInjectable = false;
      InjectableCondition = string.Empty;
      InjectableBegin = string.Empty;
      InjectableEnd = string.Empty;
      DataBaseType = DataBaseType.Unknown;
      UseConditions = true;
 }
开发者ID:mcorrientes,项目名称:Web-Security-Toolset,代码行数:10,代码来源:InternalData.cs


示例20: Compression

        /// <summary>
        ///     压缩数据库
        /// </summary>
        /// <param name="dataType">数据库类型</param>
        /// <param name="connetionString">连接字符串</param>
        public static void Compression(string connetionString, DataBaseType dataType = DataBaseType.SqlServer)
        {
            var db = new DbExecutor(connetionString, dataType, 30);
            switch (dataType)
            {
                case DataBaseType.SQLite: db.ExecuteNonQuery(CommandType.Text, "VACUUM", null); break;

                default: throw new NotImplementedException("该数据库不支持该方法!");
            }
        }
开发者ID:SaintLoong,项目名称:Farseer.Net,代码行数:15,代码来源:DbFactory.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# DataBinding类代码示例发布时间:2022-05-24
下一篇:
C# DataBaseHelper类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap