public bool AddColumn(ProfileColumn column) { string strSql = String.Format("ALTER TABLE {0}ProfileData ADD {1} {2} DEFAULT {3} {4}",Config.MemberTablePrefix, column.ColumnName, column.DataType, column.DefaultValue, column.AllowNull ? "NULL" : "NOT NULL"); try { SqlHelper.ExecuteNonQuery(SqlHelper.ConnString, CommandType.Text, strSql + column, null); } catch (Exception) { return false; } return true; }
public static bool AddColumn(ProfileColumn column) { ICustomProfile dal = Factory<ICustomProfile>.Create("CustomProfile"); return dal.AddColumn(column); }