Beispiel #1
0
 /// <summary>
 /// Adds a parameter to the call (for all types other than strings)
 /// </summary>
 /// <param name="ID">Name of the parameter</param>
 /// <param name="Value">Value to add</param>
 /// <param name="Direction">Direction that the parameter goes (in or out)</param>
 /// <param name="Command">Command object</param>
 /// <param name="Type">SQL type of the parameter</param>
 public static void AddParameter(this DbCommand Command, string ID, SqlDbType Type,
                                 object Value = null, ParameterDirection Direction = ParameterDirection.Input)
 {
     Command.ThrowIfNull("Command");
     ID.ThrowIfNullOrEmpty("ID");
     Command.AddParameter(ID, Type.ToDbType(), Value, Direction);
 }
 /// <summary>
 /// Adds a parameter to the call (for all types other than strings)
 /// </summary>
 /// <param name="ID">Name of the parameter</param>
 /// <param name="Value">Value to add</param>
 /// <param name="Type">SQL type of the parameter</param>
 /// <param name="Direction">Parameter direction (defaults to input)</param>
 public virtual void AddParameter(string ID, SqlDbType Type, object Value = null, ParameterDirection Direction = ParameterDirection.Input)
 {
     AddParameter(ID, Type.ToDbType(), Value, Direction);
 }
 /// <summary>
 ///     Converts a SQLDbType value to .Net type
 /// </summary>
 /// <param name="type">SqlDbType Type</param>
 /// <returns>The corresponding .Net type</returns>
 public static Type ToType(this SqlDbType type)
 {
     return(type.ToDbType().ToType());
 }
 /// <summary>
 /// Adds a parameter to the call (for all types other than strings)
 /// </summary>
 /// <param name="ID">Name of the parameter</param>
 /// <param name="Value">Value to add</param>
 /// <param name="Type">SQL type of the parameter</param>
 /// <param name="Direction">Parameter direction (defaults to input)</param>
 /// <returns>This</returns>
 public virtual SQLHelper AddParameter(string ID, SqlDbType Type, object Value = null, ParameterDirection Direction = ParameterDirection.Input)
 {
     return(AddParameter(ID, Type.ToDbType(), Value, Direction));
 }