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


C# MySql类代码示例

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


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

示例1: CrpNPCCorporation

        public CrpNPCCorporation(MySql.Data.MySqlClient.MySqlConnection mysql_connection, System.Data.SqlClient.SqlConnection sqlserver_connection)
            : base(mysql_connection, sqlserver_connection)
        {
            this._tableName = "crpNPCCorporations";

            this._fields.Add("corporationID");
            this._fields.Add("size");
            this._fields.Add("extent");
            this._fields.Add("solarSystemID");
            this._fields.Add("investorID1");
            this._fields.Add("investorShares1");
            this._fields.Add("investorID2");
            this._fields.Add("investorShares2");
            this._fields.Add("investorID3");
            this._fields.Add("investorShares3");
            this._fields.Add("investorID4");
            this._fields.Add("investorShares4");
            this._fields.Add("friendID");
            this._fields.Add("enemyID");
            this._fields.Add("publicShares");
            this._fields.Add("initialPrice");
            this._fields.Add("minSecurity");
            this._fields.Add("scattered");
            this._fields.Add("fringe");
            this._fields.Add("corridor");
            this._fields.Add("hub");
            this._fields.Add("border");
            this._fields.Add("factionID");
            this._fields.Add("sizeFactor");
            this._fields.Add("stationCount");
            this._fields.Add("stationSystemCount");
            this._fields.Add("description");
            this._fields.Add("iconID");
        }
开发者ID:NightsongEntertainment,项目名称:Data-Migrator,代码行数:34,代码来源:CrpNPCCorporation.cs

示例2: DgmEffect

        public DgmEffect(MySql.Data.MySqlClient.MySqlConnection mysql_connection, System.Data.SqlClient.SqlConnection sqlserver_connection)
            : base(mysql_connection, sqlserver_connection)
        {
            this._tableName = "dgmEffects";

            this._fields.Add("effectID");
            this._fields.Add("effectName");
            this._fields.Add("effectCategory");
            this._fields.Add("preExpression");
            this._fields.Add("postExpression");
            this._fields.Add("description");
            this._fields.Add("guid");
            this._fields.Add("iconID");
            this._fields.Add("isOffensive");
            this._fields.Add("isAssistance");
            this._fields.Add("durationAttributeID");
            this._fields.Add("trackingSpeedAttributeID");
            this._fields.Add("dischargeAttributeID");
            this._fields.Add("rangeAttributeID");
            this._fields.Add("falloffAttributeID");
            this._fields.Add("disallowAutoRepeat");
            this._fields.Add("published");
            this._fields.Add("displayName");
            this._fields.Add("isWarpSafe");
            this._fields.Add("rangeChance");
            this._fields.Add("electronicChance");
            this._fields.Add("propulsionChance");
            this._fields.Add("distribution");
            this._fields.Add("sfxName");
            this._fields.Add("npcUsageChanceAttributeID");
            this._fields.Add("npcActivationChanceAttributeID");
            this._fields.Add("fittingUsageChanceAttributeID");
        }
开发者ID:NightsongEntertainment,项目名称:Data-Migrator,代码行数:33,代码来源:DgmEffect.cs

示例3: LoadShop

        public static void LoadShop(int shopNum, MySql database)
        {
            if (shops.Shops.ContainsKey(shopNum) == false)
                shops.Shops.Add(shopNum, new Shop());

            string query = "SELECT name, " +
                "greeting, " +
                "farewell " +
                "FROM shop WHERE shop.num = \'" + shopNum + "\'";

            DataColumnCollection row = database.RetrieveRow(query);
            if (row != null)
            {
                shops[shopNum].Name = row["name"].ValueString;
                shops[shopNum].JoinSay = row["greeting"].ValueString;
                shops[shopNum].LeaveSay = row["farewell"].ValueString;
            }

            query = "SELECT trade_num, " +
                "item, " +
                "cost_num, " +
                "cost_val " +
                "FROM shop_trade WHERE shop_trade.num = \'" + shopNum + "\'";

            foreach (DataColumnCollection columnCollection in database.RetrieveRowsEnumerable(query))
            {
                int tradeNum = columnCollection["trade_num"].ValueString.ToInt();

                shops[shopNum].Items[tradeNum].GetItem = columnCollection["item"].ValueString.ToInt();
                shops[shopNum].Items[tradeNum].GiveItem = columnCollection["cost_num"].ValueString.ToInt();
                shops[shopNum].Items[tradeNum].GiveValue = columnCollection["cost_val"].ValueString.ToInt();
            }
        }
开发者ID:ScruffyKnight,项目名称:PMU-Server,代码行数:33,代码来源:ShopManagerBase.cs

示例4: LoadCharacterParty

        public static PartyData LoadCharacterParty(MySql database, string charID)
        {
            PartyData partyData = new PartyData();

            string query = "SELECT parties.PartyID " +
                "FROM parties " +
                "WHERE parties.CharID = \'" + charID + "\';";
            List<DataColumnCollection> rows = database.RetrieveRows(query);
            if (rows != null) {
                for (int i = 0; i < rows.Count; i++) {
                    partyData.PartyID = rows[i]["PartyID"].ValueString;
                }
            } else {
                return null;
            }

            query = "SELECT parties.CharID " +
                "FROM parties " +
                "WHERE parties.PartyID = \'" + partyData.PartyID + "\';";
            rows = database.RetrieveRows(query);
            if (rows != null) {
                for (int i = 0; i < rows.Count; i++) {
                    partyData.Members.Add(rows[i]["CharID"].ValueString);
                }
            }
            return partyData;
        }
开发者ID:ScruffyKnight,项目名称:PMU-Server,代码行数:27,代码来源:PartyDataManager.cs

示例5: Deoploy

 public void Deoploy(MySql.Data.MySqlClient.MySqlCommand cmd, StringBuilder sb, ref int paramCount)
 {
     if (upperBounds == null)
     {
         bool first = true;
         foreach (DataColumn col in lowerBounds.Table.Columns)
         {
             sb.Append(first ? "" : " AND ");
             sb.Append(" `" + col.ColumnName + "` = @param" + paramCount);
             cmd.Parameters.AddWithValue("@param" + paramCount++, lowerBounds[col]);
             first = false;
         }
     }
     else
     {
         bool first = true;
         foreach (DataColumn col in lowerBounds.Table.Columns)
         {
             sb.Append(first ? " `" : " AND `" + col.ColumnName + "` ");
             if (col.DataType == typeof(int) || col.DataType == typeof(double))
             {
                 sb.Append("BETWEEN @param" + paramCount + " AND @param" + paramCount + 1);
             }
             else
             {
                 sb.Append(" <= @param" + paramCount + " AND `" + col.ColumnName + "` >= @param" + paramCount + 1);
             }
             cmd.Parameters.AddWithValue("@param" + paramCount++, lowerBounds[col]);
             cmd.Parameters.AddWithValue("@param" + paramCount++, upperBounds[col]);
             first = false;
         }
     }
 }
开发者ID:rjankovic,项目名称:MySQLNEaT,代码行数:33,代码来源:ConditionMySql.cs

示例6: CrpNPCCorporationTrade

        public CrpNPCCorporationTrade(MySql.Data.MySqlClient.MySqlConnection mysql_connection, System.Data.SqlClient.SqlConnection sqlserver_connection)
            : base(mysql_connection, sqlserver_connection)
        {
            this._tableName = "crpNPCCorporationTrades";

            this._fields.Add("corporationID");
            this._fields.Add("typeID");
        }
开发者ID:NightsongEntertainment,项目名称:Data-Migrator,代码行数:8,代码来源:CrpNPCCorporationTrade.cs

示例7: Testm

        public static void Testm(MySql.Data.MySqlClient.MySqlConnection connection)
        {
            DataContext db = new DataContext(connection);

            Table<Artigo> Artigos = db.GetTable<Artigo>();

            var q = (from a in Artigos select a).ToList();
        }
开发者ID:GutoZimpel,项目名称:sirh,代码行数:8,代码来源:Class1.cs

示例8: AddGuildMember

 public static void AddGuildMember(MySql database, string guildName, string charID)
 {
     database.UpdateOrInsert("guild", new IDataColumn[] {
         database.CreateColumn(false, "CharID", charID),
         database.CreateColumn(false, "GuildName", guildName),
         database.CreateColumn(false, "GuildAccess", "1")
     });
 }
开发者ID:ScruffyKnight,项目名称:PMU-Server,代码行数:8,代码来源:PlayerDataManager.cs

示例9: MultiRowInsert

        public MultiRowInsert(MySql database, string tableName, params string[] columnNames)
        {
            this.database = database;
            this.tableName = tableName;
            this.columnNames = columnNames;

            UpdateParameters(tableName, columnNames);
        }
开发者ID:ChaotixBluix,项目名称:framework,代码行数:8,代码来源:MultiRowInsert.cs

示例10: addParam

 public void addParam(MySql.Data.MySqlClient.MySqlDbType type, string name, dynamic value = null)
 {
     MySqlParameter param = new MySqlParameter(name, type);
     param.Value = value;
     if (type == MySql.Data.MySqlClient.MySqlDbType.String)
         param.Size = -1;
     cmd.Parameters.Add(param);
 }
开发者ID:nemanja-tomic,项目名称:TorteMigration,代码行数:8,代码来源:DbMysql.cs

示例11: AgtAgentType

        public AgtAgentType(MySql.Data.MySqlClient.MySqlConnection mysql_connection, System.Data.SqlClient.SqlConnection sqlserver_connection)
            : base(mysql_connection, sqlserver_connection)
        {
            this._tableName = "agtAgentTypes";

            this._fields.Add("agentTypeID");
            this._fields.Add("agentType");
        }
开发者ID:NightsongEntertainment,项目名称:Data-Migrator,代码行数:8,代码来源:AgtAgentType.cs

示例12: AddMissionEnemyData

 public static void AddMissionEnemyData(MySql database, int difficulty, int index, MissionEnemyData data)
 {
     database.AddRow("mission_enemy", new IDataColumn[] {
         database.CreateColumn(false, "Rank", difficulty.ToString()),
         database.CreateColumn(false, "EnemyIndex", index.ToString()),
         database.CreateColumn(false, "NpcNum", data.NpcNum.ToString())
     });
 }
开发者ID:ScruffyKnight,项目名称:PMU-Server,代码行数:8,代码来源:MissionDataManager.cs

示例13: CrpNPCCorporationResearchField

        public CrpNPCCorporationResearchField(MySql.Data.MySqlClient.MySqlConnection mysql_connection, System.Data.SqlClient.SqlConnection sqlserver_connection)
            : base(mysql_connection, sqlserver_connection)
        {
            this._tableName = "crpNPCCorporationResearchFields";

            this._fields.Add("skillID");
            this._fields.Add("corporationID");
        }
开发者ID:NightsongEntertainment,项目名称:Data-Migrator,代码行数:8,代码来源:CrpNPCCorporationResearchField.cs

示例14: CreateNewAccount

 public static void CreateNewAccount(MySql database, string accountName, string encryptedPassword, string email)
 {
     database.AddRow("accounts", new IDataColumn[] {
         database.CreateColumn(false, "AccountName", accountName),
         database.CreateColumn(false, "Password", encryptedPassword),
         database.CreateColumn(false, "Email", email)
     });
 }
开发者ID:ScruffyKnight,项目名称:PMU-Server,代码行数:8,代码来源:PlayerDataManager.cs

示例15: AddMissionClientData

 public static void AddMissionClientData(MySql database, int difficulty, int index, MissionClientData data)
 {
     database.AddRow("mission_client", new IDataColumn[] {
         database.CreateColumn(false, "Rank", difficulty.ToString()),
         database.CreateColumn(false, "ClientIndex", index.ToString()),
         database.CreateColumn(false, "DexNum", data.DexNum.ToString()),
         database.CreateColumn(false, "FormNum", data.FormNum.ToString())
     });
 }
开发者ID:ScruffyKnight,项目名称:PMU-Server,代码行数:9,代码来源:MissionDataManager.cs


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