public override int ExecuteScalar(System.Data.Common.DbCommand command) { command.CommandText = command.CommandText + "; SELECT CONVERT(INT, SCOPE_IDENTITY())"; int lastid = 0; try { command.Prepare(); lastid = (int)command.ExecuteScalar(); } catch (Exception e) { throw e; } return lastid; }
public int ExecuteNonQuery(System.Data.Common.DbCommand command) { int rowNumber = 0; try { command.Prepare(); rowNumber = command.ExecuteNonQuery(); } catch (Exception e) { throw e; } return rowNumber; }
public System.Data.Common.DbDataReader Select(System.Data.Common.DbCommand command) { command.Prepare(); DbDataReader sqlReader = command.ExecuteReader(); return sqlReader; }