C# Class SqlCommandExt, code

Exibir arquivo Open project: shendongnian/code

Public Methods

Method Description
AddArrayParameters ( SqlCommand, cmd, string paramNameRoot, IEnumerable, values, SqlDbType? dbType = null, int? size = null ) : SqlParameter[],

This will add an array of parameters to a SqlCommand. This is used for an IN statement. Use the returned value for the IN part of your SQL call. (i.e. SELECT * FROM table WHERE field IN ({paramNameRoot}))

Method Details

AddArrayParameters() public static method

This will add an array of parameters to a SqlCommand. This is used for an IN statement. Use the returned value for the IN part of your SQL call. (i.e. SELECT * FROM table WHERE field IN ({paramNameRoot}))
public static AddArrayParameters ( SqlCommand, cmd, string paramNameRoot, IEnumerable, values, SqlDbType? dbType = null, int? size = null ) : SqlParameter[],
cmd SqlCommand, The SqlCommand object to add parameters to.
paramNameRoot string What the parameter should be named followed by a unique value for each value. This value surrounded by {} in the CommandText will be replaced.
values IEnumerable, The array of strings that need to be added as parameters.
dbType SqlDbType? One of the System.Data.SqlDbType values. If null, determines type based on T.
size int? The maximum size, in bytes, of the data within the column. The default value is inferred from the parameter value.
return SqlParameter[],