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)); } }
public override string ToSqlStr() { return(DbRow.getColumnNameFromIdx(this.DbColNameIdx) + " = '" + this.Value.ToString() + "'"); }
public override string ToSqlStr() { return(DbRow.getColumnNameFromIdx(this.DbColNameIdx) + " = " + ((this.Value.HasValue) ? "NULL" : "'" + this.Value + "'")); }
public override string ToSqlStr() { return(DbRow.getColumnNameFromIdx(this.DbColNameIdx) + " = " + (this.Value ? "1" : "0")); }
public override string ToSqlStr() { return(DbRow.getColumnNameFromIdx(this.DbColNameIdx) + " = " + ((this.Value.HasValue) ? ((bool)this.Value ? "1" : "0") : "NULL")); }
public override string ToSqlStr() { return(DbRow.getColumnNameFromIdx(this.DbColNameIdx) + " = '" + ((this._value.HasValue) ? ((DateTime)this._value).ToString("yyyy-MM-dd HH:mm:ss") + "'" : "NULL")); }
public string ToSqlModDateStr() { return(DbRow.getColumnNameFromIdx(this.DbColNameIdx) + " = GETDATE()"); }
public override string ToSqlStr() { return(DbRow.getColumnNameFromIdx(this.DbColNameIdx) + " = '" + this._value.ToString("yyyy-MM-dd HH:mm:ss") + "'"); }
public override string ToSqlStr() { return(DbRow.getColumnNameFromIdx(this.DbColNameIdx) + " = " + ((this.Value == null) ? "NULL" : "'" + this.Value.Replace("'", "''") + "'")); }
public override string ToSqlStr() { return(DbRow.getColumnNameFromIdx(this.DbColNameIdx) + " = " + ((this.Value.HasValue) ? ((decimal)this.Value).ToString() : "NULL")); }
// 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); }
public abstract void AddDbRow(DbRow dbRow);