Example #1
0
        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;
        }
Example #2
0
        public int ExecuteNonQuery(System.Data.Common.DbCommand command)
        {
            int rowNumber = 0;
            try
            {
                command.Prepare();
                rowNumber = command.ExecuteNonQuery();
            }
            catch (Exception e)
            {
                throw e;
            }

            return rowNumber;
        }
Example #3
0
 public System.Data.Common.DbDataReader Select(System.Data.Common.DbCommand command)
 {
     command.Prepare();
     DbDataReader sqlReader = command.ExecuteReader();
     return sqlReader;
 }