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


C# DBType类代码示例

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


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

示例1: TableBase

        /// <summary>
        /// Instantiate a Table by directly deserializing byte data from the given Deserializer.
        /// </summary>
        /// <param name="input">The Deserializer providing the data for the table.</param>
        internal TableBase(Deserializer input)
        {
            // Total byte length of the table data (ignored).
            int tableLength = input.ReadInt32();

            // Total byte length of the Table metadata.
            int tableMetadataLength = input.ReadInt32();

            // Status code (custom user-set value).
            this.Status = input.ReadSByte();
            // Column Count.
            this.ColumnCount = input.ReadInt16();

            // Initialize column-driven data store.
            ColumnType = new DBType[this.ColumnCount];
            Column = new object[this.ColumnCount];

            // Read column data types.
            for (short c = 0; c < this.ColumnCount; c++)
                ColumnType[c] = (DBType)input.ReadSByte();

            // Read column names.
            this.ColumnNameData = input.ReadRaw(tableMetadataLength - 3 - this.ColumnCount);

            // Row count.
            this.RowCount = input.ReadInt32();
        }
开发者ID:cuongit0207,项目名称:voltdb-client-csharp,代码行数:31,代码来源:TableBase.cs

示例2: WebConfigImpl

        public WebConfigImpl(FileInfo fileInfo)
        {
            Debug.Assert(null != fileInfo);
            if (!fileInfo.Exists) throw new InvalidDataException("fileInfo file does not exists.");

            string xsd = "http://chernoivanov.org/SmsDeliveryTest";
            XmlDocument xDoc = new XmlDocument();
            xDoc.Load(fileInfo.FullName);
            XmlNamespaceManager names = new XmlNamespaceManager(xDoc.NameTable);
            names.AddNamespace("a", xsd);

            XmlNode node = xDoc.SelectSingleNode("//a:DB", names);
            this.dbType = (DBType)Enum.Parse(typeof(DBType), node.Attributes["type"].Value, true);
            this.dbConnectionString = Utils.formatText(node.SelectSingleNode("a:ConnectionString/text()", names).Value).Replace("; ", ";");

            XmlNodeList nodes = xDoc.SelectNodes("//a:AudioFiles/*", names);

            if (0 == nodes.Count)
                throw new InvalidDataException("No nodes in AudioFiles");
            foreach (XmlNode n in xDoc.SelectNodes("//a:AudioFiles/*", names))
            {
                WebFileConfigImpl fileCfg = new WebFileConfigImpl(
                    n.Attributes["DirectoryForAudioFiles"].Value, 
                    n.Attributes["AudioFileExtension"].Value);
                senderConfigDictionary.Add(n.Attributes["MailSender"].Value, fileCfg);
            }
        }
开发者ID:wortjanin,项目名称:CallSelector,代码行数:27,代码来源:WebConfigImpl.cs

示例3: InitProvider

        public static IDBProvider InitProvider(DBType type, IPEndPoint ep, string user, string pwd, object other)
        {
            IDBProvider provider = null;
            switch (type)
            {
                case DBType.MSSQL:
                    {
                        provider = new MSSQLProvider();
                        provider.Username = user;
                        provider.Password = pwd;
                        provider.SetConnectionBuilder(ep, user, pwd);
                    }
                    break;
                case DBType.MYSQL:
                    {

                    }
                    break;
                case DBType.ORACLE:
                    {

                    }
                    break;
                default:
                    {
                        provider = null;
                    }
                    break;
            }
            return provider;
        }
开发者ID:rogerluo,项目名称:Stror,代码行数:31,代码来源:DBFactory.cs

示例4: Put

 public void Put(DBType typecode, int size, string value)
 {
     SortedList<int, string> map;
     if (!weighted.TryGetValue(typecode, out map))
     {
         weighted[typecode] = map = new SortedList<int, string>();
     }
     map[size] = value;
 }
开发者ID:CMONO,项目名称:elinq,代码行数:9,代码来源:TypeNames.cs

示例5: ConvertDBTypeToNativeType

        protected override void ConvertDBTypeToNativeType(IDbDataParameter p, DBType dbType)
        {
            if (SetSqlDbType == null)
            {
                SetSqlDbType = p.GetType().Module.GetType("System.Data.SqlServerCe.SqlCeParameter").GetProperty("SqlDbType", BindingFlags.Public | BindingFlags.Instance).GetSetter();

            }
            if (SetSqlDbType != null)
                SetSqlDbType(p, (SqlDbType)(int)dbType);
            else
                base.ConvertDBTypeToNativeType(p, dbType);
        }
开发者ID:jaykizhou,项目名称:elinq,代码行数:12,代码来源:SqlCeDriver.cs

示例6: Get

 public string Get(DBType typecode, int size, int precision, byte scale)
 {
     if (size == 0 && precision == 0 && scale == 0)
         return Get(typecode);
     SortedList<int, string> map;
     weighted.TryGetValue(typecode, out map);
     if (map != null && map.Count > 0)
         foreach (KeyValuePair<int, string> entry in map)
             if (size <= entry.Key || precision > 0 || scale > 0)
                 return Replace(entry.Value, size, precision, scale);
     return Replace(Get(typecode), size, precision, scale);
 }
开发者ID:CMONO,项目名称:elinq,代码行数:12,代码来源:TypeNames.cs

示例7: GetProvider

 public static IHaveDbProvider GetProvider(DBType type)
 {
     switch (type)
     {
         case DBType.SqlServer: return new SqlServerProvider();
         case DBType.SqlServerCE: return new SqlServerCEProvider();
         case DBType.MySql: return new MySqlProvider();
         case DBType.PostgreSQL:return new PostgresProvider();
         case DBType.Oracle:return new OracleProvider();
         case DBType.SQLite:return new SqliteProvider();
     }
     throw new Exception("Unkown provider");
 }
开发者ID:apacifico,项目名称:SqlFu,代码行数:13,代码来源:ProviderFactory.cs

示例8: GetDBTypeString

 private static string GetDBTypeString(DBType dbType)
 {
     switch (dbType)
     {
         case DBType.Date:
             return "Date";
         case DBType.Integer:
             return "Integer";
         case DBType.NVarChar:
             return "Nvarchar";
         default:
             return "Ntext";
     }
 }
开发者ID:enkelmedia,项目名称:UmbraCodeFirst,代码行数:14,代码来源:DataTypeDefinitionSynchronizer.cs

示例9: button2_Click

 private void button2_Click(object sender, EventArgs e)
 {
     DbSettings dialog = new DbSettings();
     DialogResult result = dialog.ShowDialog(this);
     if (result == DialogResult.OK)
     {
         DBType = dialog.DBType;
         DbUser = dialog.DBUser;
         DbPass = dialog.DBPass;
         DbName = dialog.DBName;
         DbAddr = dialog.DBAddr;
         DbTNam = dialog.DBTNam;
     }
 }
开发者ID:xuzhao1211,项目名称:IIsLogExport,代码行数:14,代码来源:MainForm.cs

示例10: GetDBDialog

 public static IDBDialog GetDBDialog(DBType dbTypeName)
 {
     switch (dbTypeName)
     {
         case DBType.Oracle:
             return new OracleDBDialog();
         case DBType.MySql:
             return new MySQLDBDialog();
         case DBType.SqlServer:
             return new SqlServerDBDialog();
         default:
             return null;
     }
 }
开发者ID:EsperanzaHargis,项目名称:OracleDatabaseView,代码行数:14,代码来源:DBDialogFactory.cs

示例11: Create

        public static IDBAccess Create(DBType type)
        {
            IDBAccess IRet = null;
            switch (type)
            {
                case DBType.Access:
                    IRet = new Access(type);
                    break;

                case DBType.SQL:
                    IRet = new SQL(type);
                    break;

                default:
                    break;
            }
            return IRet;
        }
开发者ID:josecohenca,项目名称:xmlconvertsql,代码行数:18,代码来源:clsSQL.cs

示例12: GetStatementByDBType

 public static string GetStatementByDBType(SQLStatementType statetype, DBType dbtype, object other)
 {
     string statement;
     switch (statetype)
     {
         case SQLStatementType.EXISTSLM:
             {
                 switch (dbtype)
                 {
                     case DBType.MSSQL:
                         {
                             statement = string.Format("select count(*) from master.dbo.sysobjects where xtype = 'U' and object_id(N'{0}') = id", Settings.Default.LMTABLE);
                         }
                         break;
                 }
             }
             break;
     }
     return null;
 }
开发者ID:rogerluo,项目名称:Stror,代码行数:20,代码来源:DBFactory.cs

示例13: WorkingSet

        public WorkingSet(string plantConnStr)
        {
            _dbType = Utility.GetDBType(plantConnStr);
              _connStrs[Constants.SPPID_PLANT_SCHEMA] = plantConnStr;

              if (Utility.GetDBType(plantConnStr) == DBType.ORACLE)
              {
            DataTable result = DBManager.Instance.ExecuteQuery(plantConnStr, Constants.ORACLE_GET_CURRENT_SCHEMA);

            if (result != null && result.Rows.Count > 0)
            {
              _plantSchema = result.Rows[0][0].ToString();
            }
              }
              else if (Utility.GetDBType(plantConnStr) == DBType.SQLServer)
              {
            //TODO: need to verify
            _plantSchema = "dbo";
              }
        }
开发者ID:iringtools,项目名称:sp_pid,代码行数:20,代码来源:WorkingSet.cs

示例14: SqlType

 SqlType(DBType dbType)
 {
     this.DbType = dbType;
     hashCode = dbType.GetHashCode();
 }
开发者ID:jaykizhou,项目名称:elinq,代码行数:5,代码来源:SqlType.cs

示例15: showForm

 DB showForm(DBType t, DB db = null)
 {
     NewForm newForm = new NewForm(t);
     if (db != null) newForm.db = db;
     if (newForm.ShowDialog() == System.Windows.Forms.DialogResult.OK)
     {
         return newForm.db;
     }
     return null;
 }
开发者ID:ironmp,项目名称:MongoView,代码行数:10,代码来源:ConnectForm.cs


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