📄 smartsoft.common.sql.dbfactory.cs
字号:
else
{
throw new Exception("数据库命令事务非查询错误!");
}
}
}
catch (Exception e)
{
非查询操作IsOK = false;
this.操作失败(e);
}
return 非查询操作IsOK;
}
//-----------------------
protected object 数据库命令标量查询Object(CommandType 数据库命令类型CommandType, string 数据库命令文本CommandText, params IDbDataParameter[] 数据库命令参数CommandParameters)
{
this.操作命令String = "数据库命令标量查询Object";
object 数据值ObjectX = null;
try
{
数据值ObjectX = SmartSoft.Common.SQL.DBFactory.数据库命令.数据库命令标量查询Object(this.数据库类型名称, this.数据库链接字符串, 数据库命令类型CommandType, 数据库命令文本CommandText, 数据库命令参数CommandParameters);
this.操作成功();
}
catch (Exception e)
{
this.操作失败(e);
}
return 数据值ObjectX;
}
protected string 数据库命令标量查询String(CommandType 数据库命令类型CommandType, string 数据库命令文本CommandText, params IDbDataParameter[] 数据库命令参数CommandParameters)
{
this.操作命令String = "数据库命令标量查询String";
string 数据StringX = "";
try
{
数据StringX = SmartSoft.Common.SQL.DBFactory.数据库命令.数据库命令标量查询String(this.数据库类型名称, this.数据库链接字符串, 数据库命令类型CommandType, 数据库命令文本CommandText, 数据库命令参数CommandParameters);
this.操作成功();
}
catch (Exception e)
{
this.操作失败(e);
}
return 数据StringX;
}
protected int 数据库命令标量查询Int(CommandType 数据库命令类型CommandType, string 数据库命令文本CommandText, params IDbDataParameter[] 数据库命令参数CommandParameters)
{
this.操作命令String = "数据库命令标量查询Int";
int 数据IntX = 0;
try
{
数据IntX = SmartSoft.Common.SQL.DBFactory.数据库命令.数据库命令标量查询Int(this.数据库类型名称, this.数据库链接字符串, 数据库命令类型CommandType, 数据库命令文本CommandText, 数据库命令参数CommandParameters);
this.操作成功();
}
catch (Exception e)
{
this.操作失败(e);
}
return 数据IntX;
}
protected byte[] 数据库命令标量查询Byte(CommandType 数据库命令类型CommandType, string 数据库命令文本CommandText, params IDbDataParameter[] 数据库命令参数CommandParameters)
{
this.操作命令String = "数据库命令标量查询Byte";
byte[] 数据ByteX = null;
try
{
数据ByteX = SmartSoft.Common.SQL.DBFactory.数据库命令.数据库命令标量查询Byte(this.数据库类型名称, this.数据库链接字符串, 数据库命令类型CommandType, 数据库命令文本CommandText, 数据库命令参数CommandParameters);
this.操作成功();
}
catch (Exception e)
{
this.操作失败(e);
}
return 数据ByteX;
}
//-------------------------
protected System.Data.DataSet 通用DataSet查询(string 数据表名称, CommandType 数据库命令类型CommandType, string 数据库命令文本CommandText, params IDbDataParameter[] 数据库命令参数CommandParameters)
{
this.操作命令String = "数据表DataSet查询";
System.Data.DataSet 数据表DataSetX = new System.Data.DataSet();
try
{
数据表DataSetX = SmartSoft.Common.SQL.DBFactory.数据库命令.通用DataSet查询(数据表名称,this.数据库类型名称, this.数据库链接字符串, 数据库命令类型CommandType, 数据库命令文本CommandText, 数据库命令参数CommandParameters);
this.操作成功();
}
catch (Exception e)
{
this.操作失败(e);
}
return 数据表DataSetX;
}
protected System.Data.DataTable 通用DataTable查询(string 数据表名称, CommandType 数据库命令类型CommandType, string 数据库命令文本CommandText, params IDbDataParameter[] 数据库命令参数CommandParameters)
{
this.操作命令String = "数据表DataTable查询";
System.Data.DataTable 数据表DataTableX = new DataTable();
try
{
数据表DataTableX = SmartSoft.Common.SQL.DBFactory.数据库命令.通用DataTable查询(数据表名称, this.数据库类型名称, this.数据库链接字符串, 数据库命令类型CommandType, 数据库命令文本CommandText, 数据库命令参数CommandParameters);
this.操作成功();
}
catch (Exception e)
{
this.操作失败(e);
}
return 数据表DataTableX;
}
protected System.Data.IDataReader 通用DataReader查询(CommandType 数据库命令类型CommandType, string 数据库命令文本CommandText, params IDbDataParameter[] 数据库命令参数CommandParameters)
{
this.操作命令String = "数据表DataReader查询";
System.Data.IDataReader 数据表DataReaderX = null;
try
{
数据表DataReaderX = SmartSoft.Common.SQL.DBFactory.数据库命令.通用DataReader查询(this.数据库类型名称, this.数据库链接字符串, 数据库命令类型CommandType, 数据库命令文本CommandText, 数据库命令参数CommandParameters);
this.操作成功();
}
catch (Exception e)
{
this.操作失败(e);
}
return 数据表DataReaderX;
}
//--------------------------
protected object 数据值查询Object(string 数据值名称, CommandType 数据库命令类型CommandType, string 数据库命令文本CommandText, params IDbDataParameter[] 数据库命令参数CommandParameters)
{
this.操作命令String = "数据值查询Object";
object 数据值Object = null;
try
{
数据值Object = SmartSoft.Common.SQL.DBFactory.数据库命令.数据值查询Object(数据值名称, this.数据库类型名称, this.数据库链接字符串, 数据库命令类型CommandType, 数据库命令文本CommandText, 数据库命令参数CommandParameters);
this.操作成功();
}
catch (Exception e)
{
this.操作失败(e);
}
return 数据值Object;
}
protected string 数据值查询String(string 数据值名称, CommandType 数据库命令类型CommandType, string 数据库命令文本CommandText, params IDbDataParameter[] 数据库命令参数CommandParameters)
{
this.操作命令String = "数据值查询String";
string 数据值String = "";
try
{
数据值String = SmartSoft.Common.SQL.DBFactory.数据库命令.数据值查询String(数据值名称, this.数据库类型名称, this.数据库链接字符串, 数据库命令类型CommandType, 数据库命令文本CommandText, 数据库命令参数CommandParameters);
this.操作成功();
}
catch (Exception e)
{
this.操作失败(e);
}
return 数据值String;
}
protected ulong 数据值查询Ulong(string 数据值名称, CommandType 数据库命令类型CommandType, string 数据库命令文本CommandText, params IDbDataParameter[] 数据库命令参数CommandParameters)
{
this.操作命令String = "数据值查询Ulong";
ulong 数据值Ulong = 0;
try
{
数据值Ulong = SmartSoft.Common.SQL.DBFactory.数据库命令.数据值查询Ulong(数据值名称, this.数据库类型名称, this.数据库链接字符串, 数据库命令类型CommandType, 数据库命令文本CommandText, 数据库命令参数CommandParameters);
this.操作成功();
}
catch (Exception e)
{
this.操作失败(e);
}
return 数据值Ulong;
}
protected byte[] 数据值查询Byte(string 数据值名称, CommandType 数据库命令类型CommandType, string 数据库命令文本CommandText, params IDbDataParameter[] 数据库命令参数CommandParameters)
{
this.操作命令String = "数据值查询Byte";
byte[] 数据值Byte = null;
try
{
数据值Byte = SmartSoft.Common.SQL.DBFactory.数据库命令.数据值查询Byte(数据值名称, this.数据库类型名称, this.数据库链接字符串, 数据库命令类型CommandType, 数据库命令文本CommandText, 数据库命令参数CommandParameters);
this.操作成功();
}
catch (Exception e)
{
this.操作失败(e);
}
return 数据值Byte;
}
//-----------------------------------
#endregion 基础命令
#region 基础命令 设置数据库命令参数
protected System.Data.IDbDataParameter 创建命令参数CommandParameterObject(string 参数名称String, object 参数值Object, System.Data.DbType 数据类型DbType, System.Data.ParameterDirection 参数方向ParameterDirection)
{
this.操作命令String = "设置数据库命令双浮点参数";
System.Data.IDbDataParameter 数据库命令参数CommandParameterX = null;
try
{
数据库命令参数CommandParameterX = SmartSoft.Common.SQL.DBFactory.数据库命令.创建命令参数CommandParameterObject(this.数据库类型名称, 参数名称String, 参数值Object, 数据类型DbType, 参数方向ParameterDirection);
this.操作成功();
}
catch (Exception e)
{
this.操作失败(e);
}
return 数据库命令参数CommandParameterX;
}
protected System.Data.IDbDataParameter 创建命令参数CommandParameterObject(string 参数名称String, object 参数值Object, System.Data.ParameterDirection 参数方向ParameterDirection)
{
this.操作命令String = "设置数据库命令双浮点参数";
System.Data.IDbDataParameter 数据库命令参数CommandParameterX = null;
try
{
数据库命令参数CommandParameterX = SmartSoft.Common.SQL.DBFactory.数据库命令.创建命令参数CommandParameterObject(this.数据库类型名称, 参数名称String, 参数值Object, 参数方向ParameterDirection);
this.操作成功();
}
catch (Exception e)
{
this.操作失败(e);
}
return 数据库命令参数CommandParameterX;
}
protected System.Data.IDbDataParameter 创建命令参数CommandParameter(string 参数名称String, Decimal 参数值Decimal, System.Data.ParameterDirection 参数方向ParameterDirection)
{
this.操作命令String = "设置数据库命令双浮点参数";
System.Data.IDbDataParameter 数据库命令参数CommandParameterX = null;
try
{
数据库命令参数CommandParameterX = SmartSoft.Common.SQL.DBFactory.数据库命令.创建命令参数CommandParameter(this.数据库类型名称, 参数名称String, 参数值Decimal, 参数方向ParameterDirection);
this.操作成功();
}
catch (Exception e)
{
this.操作失败(e);
}
return 数据库命令参数CommandParameterX;
}
protected System.Data.IDbDataParameter 创建命令参数CommandParameter(string 参数名称String, ulong 参数值Ulong, System.Data.ParameterDirection 参数方向ParameterDirection)
{
this.操作命令String = "设置数据库命令长整参数";
System.Data.IDbDataParameter 数据库命令参数CommandParameterX = null;
try
{
数据库命令参数CommandParameterX = SmartSoft.Common.SQL.DBFactory.数据库命令.创建命令参数CommandParameter(this.数据库类型名称, 参数名称String, 参数值Ulong, 参数方向ParameterDirection);
this.操作成功();
}
catch (Exception e)
{
this.操作失败(e);
}
return 数据库命令参数CommandParameterX;
}
protected System.Data.IDbDataParameter 创建命令参数CommandParameter(string 参数名称String, DateTime 参数值DateTime, System.Data.ParameterDirection 参数方向ParameterDirection)
{
this.操作命令String = "设置数据库命令时间参数";
System.Data.IDbDataParameter 数据库命令参数CommandParameterX = null;
try
{
数据库命令参数CommandParameterX = SmartSoft.Common.SQL.DBFactory.数据库命令.创建命令参数CommandParameter(this.数据库类型名称, 参数名称String, 参数值DateTime, 参数方向ParameterDirection);
this.操作成功();
}
catch (Exception e)
{
this.操作失败(e);
}
return 数据库命令参数CommandParameterX;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -