本文整理汇总了C#中ParameterDirection类的典型用法代码示例。如果您正苦于以下问题:C# ParameterDirection类的具体用法?C# ParameterDirection怎么用?C# ParameterDirection使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ParameterDirection类属于命名空间,在下文中一共展示了ParameterDirection类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: AddSqlParameter
/// <summary>
/// SQLのパラメータを追加します。サニタイジング(SQLインジェクション対策)をします
/// </summary>
/// <param name="cmd"></param>
/// <param name="direction"></param>
/// <param name="paramName"></param>
/// <param name="type"></param>
/// <param name="value">値がnullの場合はDBNull.Valueを挿入します</param>
public static void AddSqlParameter(SqlCommand cmd, ParameterDirection direction, string paramName, SqlDbType type, Object value)
{
if (cmd == null)
{
return;
}
if (string.IsNullOrEmpty(paramName) || string.IsNullOrWhiteSpace(paramName))
{
return;
}
if (value == null)
{
value = DBNull.Value;
}
SqlParameter param = cmd.CreateParameter();
param.ParameterName = paramName;
param.SqlDbType = type;
param.Direction = direction;
param.Value = value;
cmd.Parameters.Add(param);
}
开发者ID:hiroakit,项目名称:blog,代码行数:33,代码来源:HNKSqlCommandHelper.cs
示例2: MySqlParameter
internal MySqlParameter(string name, GodLesZ.Library.MySql.Data.MySqlClient.MySqlDbType type, ParameterDirection dir, string col, DataRowVersion ver, object val)
: this(name, type) {
this.direction = dir;
this.sourceColumn = col;
this.sourceVersion = ver;
this.Value = val;
}
开发者ID:GodLesZ,项目名称:svn-dump,代码行数:7,代码来源:MySqlParameter.cs
示例3: AddParameter
public virtual DbParameter AddParameter(DbCommand dm, string name, DbType dbType, int size,
ParameterDirection direction, bool nullable, byte precision, byte scale, string sourceColumn,
DataRowVersion sourceVersion, object value)
{
////if (dbType == DbType.String)
//// throw new Exception("请不要使用DbType.String进行数据库查询!");
if (CheckInjectAttackForSp(dm, value))
throw new Exception("输入的部分内容可能对系统稳定性造成影响,操作已停止![" + value + "]");
DbParameter param = this.ProviderFactory.CreateParameter();
if (param != null)
{
param.ParameterName = name;
param.DbType = dbType;
param.Size = size;
param.Value = value ?? DBNull.Value;
param.Direction = direction;
param.IsNullable = nullable;
param.SourceColumn = sourceColumn;
param.SourceVersion = sourceVersion;
dm.Parameters.Add(param);
}
return param;
}
开发者ID:yuzhaocai,项目名称:stonefw,代码行数:25,代码来源:Database.cs
示例4: Parameters
public Parameters(string Name, object Value,DbType dbType)
{
ParamName = Name;
ParamValue = Value;
ParamDbType = dbType;
ParamDirection = ParameterDirection.Input;
}
开发者ID:xlgwr,项目名称:RFID,代码行数:7,代码来源:SQLiteHelper.cs
示例5: Add
public override void Add(string name, object value = null, DbGenericType? dbType = null, ParameterDirection? direction = null, int? size = null)
{
if (value is bool)
value = (bool)value ? 1 : 0; //Oracle doesn't like BOOL.
base.Add(name, value, dbType, direction, size);
}
开发者ID:bucknellu,项目名称:Nyan,代码行数:7,代码来源:OracleDynamicParameters.cs
示例6: CreateParameter
public DbParameter CreateParameter(Type connectionType, string sourceColumn, ParameterDirection parameterDirection, DbType parameterDbType, int parameterSize, byte parameterPrecision, byte parameterScale, bool parameterNullable, string parameterName, object parameterValue)
{
DbParameter dbParameter;
if ((object)connectionType == null)
throw new ArgumentNullException(nameof(connectionType));
using (DbConnection dbConnection = (DbConnection)Activator.CreateInstance(connectionType))
{
using (DbCommand dbCommand = dbConnection.CreateCommand())
dbParameter = dbCommand.CreateParameter();
dbParameter.ParameterName = parameterName;
dbParameter.Size = parameterSize;
dbParameter.Value = parameterValue;
dbParameter.Direction = parameterDirection;
dbParameter.DbType = parameterDbType;
this.ReflectionFascade.SetLogicalPropertyValue(dbParameter, "IsNullable", parameterNullable, true, false);
dbParameter.Precision = parameterPrecision;
dbParameter.Scale = parameterScale;
dbParameter.SourceColumn = sourceColumn;
return dbParameter;
}
}
开发者ID:textmetal,项目名称:main,代码行数:25,代码来源:AdoNetBufferingFascade.cs
示例7: Add
/// <summary>
/// ref�ν� SqlParameter[]�� �Ƽ� ���ο� SqlParameter �� ���� Array�� �߰��Ѵ�.
/// </summary>
/// <param name="paramArray">������ SqlParameter[]</param>
/// <param name="parameterName">���Ӱ� �����ϰ��� �ϴ� SqlParamter �� ����� �̸�</param>
/// <param name="paramValue">���Ӱ� �����ϰ��� �ϴ� SqlParamter �� ����� ��</param>
/// <param name="direction">SqlParameter�� ��� �Ӽ�����</param>
public static void Add( ref SqlParameter[] paramArray, string parameterName, object paramValue, ParameterDirection direction )
{
SqlParameter parameter = new SqlParameter(parameterName, paramValue);
parameter.Direction = direction;
Add(ref paramArray, parameter);
}
开发者ID:relic4160,项目名称:smframework,代码行数:14,代码来源:DbParamHelper.cs
示例8: Add
public IDbDataParameter Add(string paramName, Enum paramType, int paramSize, ParameterDirection paramDirection, byte precision, byte scale, string sourceColumn, object paramValue)
{
IDbDataParameter param = _command.CreateParameter();
param.ParameterName = paramName;
if(paramType is DbType)
{
param.DbType = (DbType)paramType;
}
param.Direction = paramDirection;
if(sourceColumn != null && sourceColumn != string.Empty)
param.SourceColumn = sourceColumn;
if(paramSize > 0)
param.Size = paramSize;
if(precision > 0)
param.Precision = precision;
if(scale > 0)
param.Scale = scale;
if(paramValue != null && param.Value != DBNull.Value)
param.Value = paramValue;
_parameters.Add(param);
return param;
}
开发者ID:sidneylimafilho,项目名称:InfoControl,代码行数:34,代码来源:DataParameterCollection.cs
示例9: DBParameter
/// <summary>
/// Creates a parameter with the name, value, data type and direction specified.
/// </summary>
/// <param name="name">Parameter name</param>
/// <param name="value">Value associated with the parameter</param>
/// <param name="dbType">Data type</param>
/// <param name="paramDirection">Parameter direction</param>
public DBParameter(string name, object value, DbType dbType, ParameterDirection paramDirection)
{
_name = name;
_value = value;
_type = dbType;
_paramDirection = paramDirection;
}
开发者ID:sergiokml,项目名称:DALC4NET,代码行数:14,代码来源:DBParameter.cs
示例10: DefineParameter
public override DbParameter DefineParameter(string parameterName, DbType dbType, ParameterDirection direction)
{
SqlCommand sqlCmd = (SqlCommand)base.DbCommand;
SqlParameter sqlParm = sqlCmd.Parameters.Add(parameterName, (SqlDbType)SqlDbTypeMap[(int)dbType].ProviderDbType);
sqlParm.Direction = direction;
return sqlParm;
}
开发者ID:rreynolds-yp,项目名称:csharp-swift-consoleclient,代码行数:7,代码来源:SqlParameterBinder.cs
示例11: RoutineParameter
public RoutineParameter(string name, SqlType type, ParameterDirection direction, ParameterAttributes attributes)
{
Attributes = attributes;
Direction = direction;
Type = type;
Name = name;
}
开发者ID:ArsenShnurkov,项目名称:deveeldb,代码行数:7,代码来源:RoutineParameter.cs
示例12: AddSqlPrameter
//thoai Add sql parameter
protected static SqlParameter AddSqlPrameter(string parameterName, SqlDbType dbType, int size, ParameterDirection direction, object value)
{
SqlParameter parameter = new SqlParameter(parameterName, dbType, size);
parameter.Direction = direction;
parameter.Value = value;
return parameter;
}
开发者ID:damthoai,项目名称:tinh-viet-co,代码行数:8,代码来源:BaseDAO.cs
示例13: CreateParameter
/// <summary>
/// 매개 변수를 사용하여 <c>SqlParameter</c>클래스의 새 인스턴스를 반환합니다.
/// </summary>
/// <param name="parameterName">매핑할 매개 변수의 이름</param>
/// <param name="dbType"><c>SqlDbType</c>값 중 하나</param>
/// <param name="size">매개 변수의 길이</param>
/// <param name="direction"><c>ParameterDirection</c>값 중 하나</param>
/// <returns><c>SqlParameter</c>클래스의 새 인스턴스</returns>
public static SqlParameter CreateParameter(string parameterName, SqlDbType dbType, int size, ParameterDirection direction)
{
SqlParameter ret = CreateParameter(parameterName, dbType);
ret.Direction = direction;
ret.Size = size;
return ret;
}
开发者ID:tomochandv,项目名称:Test,代码行数:15,代码来源:SqlParameterhelper.cs
示例14: AddParameter
public static IDbCommand AddParameter(this IDbCommand command, string name, DbType type, object value, int size, ParameterDirection direction)
{
var parameter = command.NewParameter(name, type, direction, value, size);
command.Parameters.Add(parameter);
return command;
}
开发者ID:alanstevens,项目名称:Contrive,代码行数:7,代码来源:AddDbParameterExtensions.cs
示例15: CreateParameter
public static DbParameter CreateParameter(string name, DbType type, ParameterDirection direction)
{
SqlParameter parameter = CreateParameter(name);
parameter.DbType = type;
parameter.Direction = direction;
return parameter;
}
开发者ID:johnpipo1712,项目名称:Misuka,代码行数:7,代码来源:SQLParameter.cs
示例16: DB2Parameter
public DB2Parameter(string name, DB2Type type)
{
direction = ParameterDirection.Input;
sourceVersion = DataRowVersion.Current;
this.ParameterName = name;
this.DB2Type = type;
}
开发者ID:KonajuGames,项目名称:SharpLang,代码行数:7,代码来源:DB2Parameter.cs
示例17: AddParameter
public Command AddParameter(string name,object value,ParameterDirection direction)
{
var para = new Parameter {Name = name, Value = value, Direction = direction};
if (_parameters.Count(t => t.Name == name) == 0)
_parameters.Add(para);
return this;
}
开发者ID:shoy160,项目名称:Shoy.Common,代码行数:7,代码来源:Command.cs
示例18: SqlParam
public SqlParam(string paramName, object paramValue, ParameterDirection paramDirection, SqlDbType type)
{
Name = paramName;
Direction = paramDirection;
Value = paramValue;
Type = type;
}
开发者ID:girmateshe,项目名称:OAuth,代码行数:7,代码来源:SqlParam.cs
示例19: ProcedureParameter
public ProcedureParameter(string name, ParameterType type, ParameterDirection direction, object value)
{
Name = name;
Type = type;
Direction = direction;
Value = value;
}
开发者ID:rohitdaryanani,项目名称:TekSuite,代码行数:7,代码来源:ProcedureParameter.cs
示例20: CreateParameter
public static OracleParameter CreateParameter(ParameterDirection direction, string paramName, OracleDbType dbType, int size, object value)
{
OracleParameter param = new OracleParameter(paramName, dbType, size);
param.Value = value;
param.Direction = direction;
return param;
}
开发者ID:hj-nicholas,项目名称:BaseFrame,代码行数:7,代码来源:OracleHelper_static.cs
注:本文中的ParameterDirection类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论