コード例 #1
0
 public override void getData(SqlDataReader rdr, int ord)
 {
     try
     {
         this._value   = rdr.GetInt64(ord);
         this.modified = false;
     }
     catch (Exception exc)
     {
         throw new DbAccessException(string.Format("Error reading column '{0}' - {1}", DbRow.getColumnNameFromIdx(this.DbColNameIdx), exc.Message));
     }
 }
コード例 #2
0
 public override string ToSqlStr()
 {
     return(DbRow.getColumnNameFromIdx(this.DbColNameIdx) + " = '" + this.Value.ToString() + "'");
 }
コード例 #3
0
 public override string ToSqlStr()
 {
     return(DbRow.getColumnNameFromIdx(this.DbColNameIdx) + " = " + ((this.Value.HasValue) ? "NULL" : "'" + this.Value + "'"));
 }
コード例 #4
0
 public override string ToSqlStr()
 {
     return(DbRow.getColumnNameFromIdx(this.DbColNameIdx) + " = " + (this.Value ? "1" : "0"));
 }
コード例 #5
0
 public override string ToSqlStr()
 {
     return(DbRow.getColumnNameFromIdx(this.DbColNameIdx) + " = " + ((this.Value.HasValue) ? ((bool)this.Value ? "1" : "0") : "NULL"));
 }
コード例 #6
0
 public override string ToSqlStr()
 {
     return(DbRow.getColumnNameFromIdx(this.DbColNameIdx) + " = '" + ((this._value.HasValue) ? ((DateTime)this._value).ToString("yyyy-MM-dd HH:mm:ss") + "'" : "NULL"));
 }
コード例 #7
0
 public string ToSqlModDateStr()
 {
     return(DbRow.getColumnNameFromIdx(this.DbColNameIdx) + " = GETDATE()");
 }
コード例 #8
0
 public override string ToSqlStr()
 {
     return(DbRow.getColumnNameFromIdx(this.DbColNameIdx) + " = '" + this._value.ToString("yyyy-MM-dd HH:mm:ss") + "'");
 }
コード例 #9
0
 public override string ToSqlStr()
 {
     return(DbRow.getColumnNameFromIdx(this.DbColNameIdx) + " = " + ((this.Value == null) ? "NULL" : "'" + this.Value.Replace("'", "''") + "'"));
 }
コード例 #10
0
 public override string ToSqlStr()
 {
     return(DbRow.getColumnNameFromIdx(this.DbColNameIdx) + " = " + ((this.Value.HasValue) ? ((decimal)this.Value).ToString() : "NULL"));
 }
コード例 #11
0
        // Gets column ordinal by column name and calls getData which is must be defined in a derived class
        public void readData(SqlDataReader rdr)
        {
            int ord;

            try
            {
                ord = rdr.GetOrdinal(DbRow.getColumnNameFromIdx(DbColNameIdx));
            }
            catch (IndexOutOfRangeException)
            {
                throw new DbAccessException(string.Format("Db Column name '{0}' was not found.", DbRow.getColumnNameFromIdx(this.DbColNameIdx)));
            }
            getData(rdr, ord);
        }
コード例 #12
0
 public abstract void AddDbRow(DbRow dbRow);