protected virtual DbCommand InitializeCommand(DbCommand command)
{
if (null == command)
{
DbCommand select = GetSelectCommand();
command = select.Connection.CreateCommand();
/*if (null == command) {
// CONSIDER: throw exception
}*/
// the following properties are only initialized when the object is created
// all other properites are reinitialized on every row
/*command.Connection = select.Connection;*/ // initialized by CreateCommand
command.CommandTimeout = select.CommandTimeout;
command.Transaction = select.Transaction;
}
command.CommandType = CommandType.Text;
command.UpdatedRowSource = UpdateRowSource.None; // no select or output parameters expected
return command;
}