Files
hjha-server/MrWu/DB/MySqlParameterData.cs
xiaoou e9616125ce feat: initial commit - HJHA game server full source
6 major server modules (PdkFriendServer/GlobalSever/ServerCore/GameModule/GameNetModule) +
game logic (GameFix/GameDAL/ServerData) +
network layer (NetWorkMessage) +
data layer (ObjectModel) +
utilities (MrWu/Core/Config/CloudAPI/dll) +
adapters (zyxAdapter/base)

.NET 8.0 C# solution, 16 projects, 958 source files
2026-07-07 12:02:15 +08:00

130 lines
3.1 KiB
C#

#if MySQL
using System;
using System.Data;
using MySql.Data.MySqlClient;
namespace MrWu.DB {
/// <summary>
/// 存储过程查询键
/// </summary>
public class MySqlProcedureParameter : IProdureParameter<MySqlCommand> {
MySqlCommand _command;
/// <summary>
/// 指令
/// </summary>
public MySqlCommand command {
get => _command;
}
private string _dbName;
/// <summary>
/// 数据库名称
/// </summary>
public string dbName {
get => _dbName;
}
/// <summary>
/// 错误信息
/// </summary>
public Exception exception {
get;
set;
}
/// <summary>
/// 是否报错
/// </summary>
public bool isException {
get {
return exception != null;
}
}
private MySqlProcedureParameter() { }
internal MySqlProcedureParameter(MySqlCommand mysqlcommand,string dbName) {
this._command = mysqlcommand;
this._dbName = dbName;
}
/// <summary>
/// 释放
/// </summary>
public void Dispose() {
if (_command != null) {
_command.Dispose();
_command = null;
}
}
}
/// <summary>
/// 单独设置参数
/// </summary>
public class MySqlAloneParameter : ISqlAloneParameter<MySqlDbType> {
string _paramname;
/// <summary>
/// 参数名称
/// </summary>
public string paramname {
get => _paramname;
}
object _parmavalue;
/// <summary>
/// 参数值
/// </summary>
public object paramvalue {
get => _parmavalue;
set => _parmavalue = value;
}
MySqlDbType _type;
/// <summary>
/// 参数类型
/// </summary>
public MySqlDbType type {
get => _type;
}
int _valueLength;
/// <summary>
/// 参数长度
/// </summary>
public int valueLength {
get => _valueLength;
}
/// <summary>
/// sql语句单独设置参数
/// </summary>
/// <param name="paramname">参数名称</param>
/// <param name="paramvalue">参数值</param>
/// <param name="valuelength">参数值的长度</param>
/// <param name="type">参数类型</param>
public MySqlAloneParameter(string paramname, object paramvalue, int valuelength, MySqlDbType type = MySqlDbType.Binary) {
this._paramname = paramname;
this._parmavalue = paramvalue;
this._valueLength = valuelength;
this._type = type;
}
/// <summary>
/// Direction
/// </summary>
public ParameterDirection Direction { get; set; }
}
}
#endif