public CreateCommand ( string commandText, object args = null, CommandType commandType = CommandType.Text ) : |
||
commandText | string | |
args | object | |
commandType | CommandType | |
return |
public SqlCommand CreateCommand(string commandText, object args = null, CommandType commandType = CommandType.Text)
{
var cmd = new SqlCommand(commandText, Connection);
cmd.CommandType = commandType;
if (args != null)
{
cmd.Parameters.AddRange(ConvertObjectToSqlParams(args));
}
return cmd;
}