Friday, April 25, 2008

MCMS

 

Microsoft acquired NCompass Labs and its software NCompass Resolution became Microsoft Content Management Server (MCMS).


for example, let's say that a company has ten web developers, and the same company has 1000 authors who contribute content to the site. in the old world, those 1000 people would rely upon the ten stressed out web developers to add their content to the site. it doesn't make any sense for those 1000 people to rely upon the ten. also, it doesn't make sense to train 1000 people to use HTML just so that they can add their own material on the site.
that's where MCMS rides in on the strapping steed. the software separates the technical aspects of web page design from the rather trivial matter of adding content (which is often just text) to the site. under the web content model, the developers put time in at the beginning of the process to design the look and feel and decide exactly what they want authors to be able to do. once the site goes live, authors simply have to cut and paste (or drag and drop) their content directly into templates that the developers built. the formatting can be locked down so that the innocent authors can't make any mistakes that would break the look and feel of the site. of course, it also offers a web browser client interface.

MCMS is a dynamic web server. most sites are hard coded and they appear as they were coded. if someone wants to add a link or a page, they must change the code and re-publish the affected pages. MCMS helps this whole process happen automatically. it can do this because MCMS pages are not flat (.htm or .html) files. everything in MCMS is stored in a SQL Server database. the presentation of the data is not decided until someone asks for it. the page decides what it looks like when a browser views it. using our Application Programming Interface (API) developers can design their pages so that they change as content is added to the site. for example, a common application of our API is programming the site navigation so that new pages appear automatically. you can imagine the time that is saved coding HTML when all of the pages add themselves to the navigation links - and this is only one example.


the MCMS API is very flexible and allows developers to do all sorts of things. MCMS runs on Microsoft's Internet Information Services (IIS) so the API programming happens in ASP (VBscript and JavaScript) (the MCMS API now supports .Net).

benefits of MCMS
1. ease of content management.
on our sites, users (with rights) can login through a browser and alter web pages as easy as they would a Microsoft Word document

2. dynamic database
unlike traditional web sites MCMS stores information in a database. as soon as someone approves a change to the site, it becomes available dynamically. since MCMS is designed primarily for large organizations, having a scalable DB solution is very powerful

3. powerful and flexible programming interface (API).
although Resolution is entirely usable out of the box, MCMS has an amazing API. through this interface web pages become programming objects. for example, a developer can ask for a web page and find out properties like Name, Publishing Date, URL etc. the API guide is over 700 pages long.

 

 

Source: http://geeklit.blogspot.com/2005/05/about-content-management-server.html

Monday, December 17, 2007

Description

Reliance Standard Life Insurance Company (Reliance Standard) is a leading insurance carrier specializing in innovative and flexible employee benefits solutions including disability income and group term life insurance. Reliance Standard Life Insurance Company provides insurance products and services in all states (except New York), the District of Columbia, Puerto Rico and the U.S. Virgin Islands. In New York, insurance products and services are provided through First Reliance Standard Life Insurance Company, home office: New York, N.Y. Product availability and features may vary by state. It distributes its products through independent agents and brokers. Main categorization of the products of RSLI is Voluntary & Non-Voluntary products. Non-Voluntary are those products that an employer takes on the behalf of his/her employees in the organization depending upon their individual credentials. Voluntary are those RSLI products that an employee applies for himself/herself without the involvement of employer. Calculation and Posting of Premiums are the most important activities of a RSLI’s product life cycle. RSLI generates bills for their customers to let them show the premium due amount that has to pay against the policies. There are several agents/brokers associated with RSLI countrywide who are responsible to sell the RSLI products. RSLI is also having TPAs to collect the relevant information about the thousands of employees of an organization in one stream at a time. RSLI is also connected with Medical Underwriter companies to undergo the process of medical approval against the claims. RSLI also holds the capability to take over the cases of an organization from some other insurance company with minimal complexity. To provide clarity on the business life cycle, RSLI is providing separate websites for employer and employee in order to deal with their intended specific tasks.

Monday, November 26, 2007

Gen L

using System;using System.Collections.Generic;using System.Text;using Csla;using BAF.Genesis.Biz;
namespace BAF.Genesis.GenericEntities.Biz{ [Serializable()] public abstract class GenericEntityListBase : BAFBusinessListBase where T : GenericEntityListBase where C : GenericEntityBase { #region Protected Variables [NotUndoable] protected int _parentID = -1; [NotUndoable] protected int _relationTypeID = -1; #endregion
#region Constructors protected GenericEntityListBase(int parentID, int relationType) { _parentID = parentID; _relationTypeID = relationType; AllowEdit = false; MarkAsChild(); } #endregion
#region Business Properties and Methods
internal void SetParentID(int parentID) { foreach (C child in this) { child.SetParentID(parentID); } _parentID = parentID; }
internal void AssertParentID() { if (_parentID <>

Gen

using System;using System.Collections.Generic;using System.Text;using Csla;using BAF.Genesis.Biz;
namespace BAF.Genesis.GenericEntities.Biz{ [Serializable()] public abstract class GenericEntityBase : BAFBusinessBase where T : GenericEntityBase { #region Private Variables private static int _lastID = -1; #endregion
#region Protected Variables [NotUndoable] protected int _ID = -1; [NotUndoable] protected int _parentID = -1; [NotUndoable] protected int _relationTypeID = -1; #endregion Protected Variables
#region Constructors protected GenericEntityBase(int parentID, int relationType) { _parentID = parentID; _relationTypeID = relationType; MarkAsChild(); } #endregion
#region Business Properties and Methods public int ID { get { return _ID; } }
internal void SetParentID(int parentID) { _parentID = parentID; }
internal void MakeIDNextNewID() { _ID = --_lastID; }
internal void AssertParentID() { if (_parentID <>

Thursday, November 22, 2007

Addresses

using System;using System.Collections.Generic;using System.Text;using Csla.Data;using BAF.Genesis.Biz;using Microsoft.Practices.EnterpriseLibrary.Data;using System.Data;using BAF.Genesis.Common.Biz;using BAF.Caching;
namespace BAF.Genesis.GenericEntities.Biz{ [Serializable()] public class Addresses : GenericEntityListBase { #region Constructors private Addresses(int parentID, int relationType) : base(parentID, relationType) { } #endregion Constructors
#region Business Properties and Methods public Address GetAddressByID(int addressID) { foreach (Address add in this) { if (add.ID == addressID) return add; } return null; } public Address CreateNewAddress() { return Address.NewAddress(_parentID, _relationTypeID, this); }
public Address CreateNewAddress(Address address) { return Address.NewCloneAddress(address, this); }
public new Address AddNew() { Address a = CreateNewAddress(); this.Add(a); return a; }
public Address AddNew(Address address) { Address a = CreateNewAddress(address); this.Add(a); return a; }
public void Remove(int addressID) { Address a = this.GetAddressByID(addressID); this.Remove(a); } #endregion Business Properties and Methods
#region Static Methods
internal static Addresses NewAddresses(int parentID, int relationType) { return new Addresses(parentID, relationType); }
internal static Addresses NewAddresses(int parentID, DBAddressRelationType relationType) { return NewAddresses(parentID, (int)relationType); } #endregion Static Methods
#region Data Access
internal static Addresses GetAddresses(int parentID, int relationType) { Addresses a = new Addresses(parentID, relationType); a.Fetch(); return a; }
internal static Addresses GetAddresses(SafeDataReader dr, int parentID, int relationType) { Addresses a = new Addresses(parentID, relationType); a.Fetch(dr); return a; }
internal static Addresses GetAddresses(int parentID, DBAddressRelationType relationType) { return GetAddresses(parentID, (int)relationType); }
internal static Addresses GetAddresses(SafeDataReader dr, int parentID, DBAddressRelationType relationType) { return GetAddresses(dr, parentID, (int)relationType); }
private void Fetch(SafeDataReader dr) { while (dr.Read()) { this.Add(Address.GetAddress(dr, _parentID, _relationTypeID)); } }
private void Fetch() { try { Database db = DatabaseFactory.CreateDatabase("GenesisDB"); string spName = "ADDRESSP.GETADDRESSTLIST"; System.Data.Common.DbCommand dbCommand = db.GetStoredProcCommand(spName);
db.AddInParameter(dbCommand, "pnParentID", DbType.Int32, _parentID); db.AddInParameter(dbCommand, "pnRelationTypeID", DbType.Int32, _relationTypeID); db.AddInParameter(dbCommand, "pcUserName", DbType.String, UserName); dbCommand.Parameters.Add(new System.Data.OracleClient.OracleParameter("cur_OUT", System.Data.OracleClient.OracleType.Cursor, 2000, ParameterDirection.Output, true, 0, 0, "", DataRowVersion.Default, Convert.DBNull));
using (SafeDataReader dr = new SafeDataReader(db.ExecuteReader(dbCommand))) // Automatically closes the DataReader { while(dr.Read()) { this.Add(Address.GetAddress(dr, _parentID, _relationTypeID)); } } } catch (Exception ex) { throw ex; } }
internal void Update(T parent) where T : BAFBusinessBase { if (parent.IsDeleted) {//Delete all Addresses and their relations DeleteAddresses(_parentID, _relationTypeID); return; }
//Delete objects in the deleted list foreach (Address aDeleted in DeletedList) aDeleted.DeleteSelf(); //now that they are deleted, remove them from memory too DeletedList.Clear();
// Update or Insert child objects foreach (Address a in this) { if (a.IsNew) a.Insert(); else a.Update(); } }
internal static void DeleteAddresses(int parentID, int relationType) { Address.DeleteAddress(parentID, relationType); }
internal static void DeleteAddresses(int parentID, DBAddressRelationType relationType) { DeleteAddresses(parentID, (int)relationType); } #endregion Data Access
#region State List
public static State StateList { get { if (!ApplicationCache.Contains("State_StateList")) { State _stateList = State.GetStateList(); ApplicationCache.Add("State_StateList", _stateList); return _stateList; }
return (State)ApplicationCache.GetData("State_StateList"); } } #endregion
#region Country State List
public static State CountryStateList { get { return State.GetStateList(true); } } #endregion
#region Country List
public static Country CountryList { get { if (!ApplicationCache.Contains("Country_CountryList")) { Country _countryList = Country.GetList(new NameValueList.NameValuePair(-1, "[No Data]"), new NameValueList.NameValuePair(-1, "[Select Country]")); ApplicationCache.Add("Country_CountryList", _countryList); return _countryList; } return (Country)ApplicationCache.GetData("Country_CountryList"); } } #endregion
#region Public Methods public new void BeginEdit() { foreach (Address address in this) address.BeginEdit(); }
public new void ApplyEdit() { foreach (Address address in this) address.ApplyEdit(); }
public new void CancelEdit() { foreach (Address address in this) address.CancelEdit(); } #endregion }}

Address

using System;using System.Collections.Generic;using System.Text;using System.Data;using System.Data.OracleClient;using BAF.Genesis.Common.Biz;using BAF.Caching;using Csla.Data;using Microsoft.Practices.EnterpriseLibrary.Data;using System.Threading;using Csla.Validation;using Csla;
namespace BAF.Genesis.GenericEntities.Biz{ [Serializable()] public class Address : GenericEntityBase
{ #region Member Variables private int _addressTypeID = -1; private string _addressLine1 = string.Empty; private string _addressLine2 = string.Empty; private string _city = string.Empty; private int _state = -1; private string _zip = string.Empty; private int _country = 1; private bool _isPrimary = false; [NotUndoable()] [NonSerialized()] private Addresses _tmpParentCollection = null; #endregion Member Variables
#region Constants
/// /// StateID used for invalid state /// public const int CONST_INVALID_STATE_ID = -2;
#endregion Constants
#region Constructors private Address(int parentID, int relationType, Addresses addresses) : base(parentID, relationType) { _tmpParentCollection = addresses; _entityName = "Address"; }
private Address(int parentID, int relationType) : base(parentID, relationType) { _entityName = "Address"; } #endregion
#region Business Properties and Methods
public int AddressTypeID { get { return _addressTypeID; } set { if (_addressTypeID != value) { _addressTypeID = value; PropertyHasChanged(); } } }
public string AddressTypeName { get { return AddressTypes.Value(_addressTypeID); } }
public string AddressLine1 { get { return _addressLine1; } set { value = value.Trim(); if (_addressLine1 != value) { _addressLine1 = value; PropertyHasChanged(); } } }
public string AddressLine2 { get { return _addressLine2; } set { value = value.Trim(); if (_addressLine2 != value) { _addressLine2 = value; PropertyHasChanged(); } } }
public string City { get { return _city; } set { value = value.Trim(); if (_city != value) { _city = value; PropertyHasChanged(); } } } public int State { get { return _state; } set { if (_state != value) { _state = value; PropertyHasChanged(); } } }
public string StateName { get { return Addresses.StateList.Value(_state); } }
public string Zip { get { return _zip; } set { value = value.Trim(); if (_zip != value) { _zip = value; PropertyHasChanged(); } } }
public int Country { get { return _country; } set { if (_country != value) { _country = value; _state = -1; PropertyHasChanged(); } } }
public bool IsPrimary { get { return _isPrimary; } set { if (_isPrimary != value) { _isPrimary = value; PropertyHasChanged(); } } }
/// /// Gets Parent Collection /// private Addresses ParentCollection { get { return (base.Parent != null ? (Addresses)base.Parent : _tmpParentCollection); } }
public override bool IsValid { get { return base.IsValid; } } #endregion Business Properties and Methods
#region Override Methods protected override object GetIdValue() { return _ID; } #endregion Override Methods
#region Static Methods public static Address NewAddress(int parentID, int relationType, Addresses addresses) { Address a = new Address(parentID, relationType, addresses); a.MakeIDNextNewID(); return a; }
public static Address NewAddress(int parentID, DBAddressRelationType relationType, Addresses addresses) { return NewAddress(parentID, (int)relationType, addresses); }
public static Address NewAddress(int parentID, DBAddressRelationType relationType) { Address a = new Address(parentID, (int)relationType); a.MakeIDNextNewID(); return a; }
public static Address NewCloneAddress(Address address, Addresses addresses) { Address ad = address.Clone(); ad.MakeIDNextNewID(); ad._tmpParentCollection = addresses; ad._addressTypeID = -1; ad._isPrimary = false; ad.MarkNew(); return ad;
} #endregion
#region Data Access internal static Address GetAddress(int parentID, int relationType) { Address a = new Address(parentID, relationType); a.Fetch(); return a; }
internal static Address GetAddress(int parentID, DBAddressRelationType relationType) { return GetAddress(parentID, (int)relationType); }
internal static Address GetAddress(SafeDataReader dr, int parentID, int relationType) { Address a = new Address(parentID, relationType); a.Fetch(dr); return a; }
internal static Address GetAddress(SafeDataReader dr, int parentID, DBAddressRelationType relationType) { return GetAddress(dr, parentID, (int)relationType); }
internal void Insert() { // if we're not dirty then don't update the database if (!this.IsDirty) return;
Database db = DatabaseFactory.CreateDatabase("GenesisDB"); string spName = "ADDRESSP.ADDADDRESST"; System.Data.Common.DbCommand dbCommand = db.GetStoredProcCommand(spName);
db.AddInParameter(dbCommand, "pnADDRESSTYPEID", DbType.Int32, _addressTypeID); db.AddInParameter(dbCommand, "pcADDRESSLINE1", DbType.String, _addressLine1); db.AddInParameter(dbCommand, "pcADDRESSLINE2", DbType.String, _addressLine2); db.AddInParameter(dbCommand, "pcCITY", DbType.String, _city); db.AddInParameter(dbCommand, "pnSTATEPROVID", DbType.Int32, (_state <= 0 ? DBNull.Value : (object)_state)); db.AddInParameter(dbCommand, "pcZIP", DbType.String, _zip); db.AddInParameter(dbCommand, "pcUsername", DbType.String, UserName); db.AddInParameter(dbCommand, "pnPRIMARYIND", DbType.Int32, _isPrimary ? 1 : 0); db.AddInParameter(dbCommand, "pnParentID", DbType.Int32, _parentID); db.AddInParameter(dbCommand, "pnRelationTypeID", DbType.Int32, _relationTypeID); db.AddOutParameter(dbCommand, "pnID", DbType.Int32, 8); db.ExecuteNonQuery(dbCommand);
_ID = (int)db.GetParameterValue(dbCommand, "pnID");
MarkOld(); }
internal void Insert(T obj) { // if we're not dirty then don't update the database if (!this.IsDirty) return;
Database db = DatabaseFactory.CreateDatabase("GenesisDB"); string spName = "ADDRESSP.ADDADDRESST"; System.Data.Common.DbCommand dbCommand = db.GetStoredProcCommand(spName);
db.AddInParameter(dbCommand, "pnADDRESSTYPEID", DbType.Int32, _addressTypeID); db.AddInParameter(dbCommand, "pcADDRESSLINE1", DbType.String, _addressLine1); db.AddInParameter(dbCommand, "pcADDRESSLINE2", DbType.String, _addressLine2); db.AddInParameter(dbCommand, "pcCITY", DbType.String, _city); db.AddInParameter(dbCommand, "pnSTATEPROVID", DbType.Int32, (_state <= 0 ? DBNull.Value : (object)_state)); db.AddInParameter(dbCommand, "pcZIP", DbType.String, _zip); db.AddInParameter(dbCommand, "pcUsername", DbType.String, UserName); db.AddInParameter(dbCommand, "pnPRIMARYIND", DbType.Int32, _isPrimary ? 1 : 0); db.AddInParameter(dbCommand, "pnParentID", DbType.Int32, _parentID); db.AddInParameter(dbCommand, "pnRelationTypeID", DbType.Int32, _relationTypeID); db.AddOutParameter(dbCommand, "pnID", DbType.Int32, 8); db.ExecuteNonQuery(dbCommand);
_ID = (int)db.GetParameterValue(dbCommand, "pnID");
MarkOld(); }
internal void Update() { // if we're not dirty then don't update the database if (!this.IsDirty) return;
Database db = DatabaseFactory.CreateDatabase("GenesisDB"); string spName = "ADDRESSP.UPDATEADDRESST"; System.Data.Common.DbCommand dbCommand = db.GetStoredProcCommand(spName);
db.AddInParameter(dbCommand, "pnID", DbType.Int32, _ID); db.AddInParameter(dbCommand, "pnADDRESSTYPEID", DbType.Int32, _addressTypeID); db.AddInParameter(dbCommand, "pcADDRESSLINE1", DbType.String, _addressLine1); db.AddInParameter(dbCommand, "pcADDRESSLINE2", DbType.String, _addressLine2); db.AddInParameter(dbCommand, "pcCITY", DbType.String, _city); db.AddInParameter(dbCommand, "pnSTATEPROVID", DbType.Int32, (_state <= 0 ? DBNull.Value : (object)_state)); db.AddInParameter(dbCommand, "pcZIP", DbType.String, _zip); db.AddInParameter(dbCommand, "pnPRIMARYIND", DbType.Int32, _isPrimary ? 1 : 0); db.AddParameter(dbCommand, "pnObjectVersion", DbType.Int32, ParameterDirection.InputOutput, null, DataRowVersion.Default, _objectVersion); db.AddInParameter(dbCommand, "pcForceUpdate", DbType.String, (_isForceUpdate ? "Y" : "N")); db.AddInParameter(dbCommand, "pcUsername", DbType.String, BizHelper.UserName); db.ExecuteNonQuery(dbCommand);
MarkOld(); }
internal void Update(T obj) { // if we're not dirty then don't update the database if (!this.IsDirty) return;
Database db = DatabaseFactory.CreateDatabase("GenesisDB"); string spName = "ADDRESSP.UPDATEADDRESST"; System.Data.Common.DbCommand dbCommand = db.GetStoredProcCommand(spName);
db.AddInParameter(dbCommand, "pnID", DbType.Int32, _ID); db.AddInParameter(dbCommand, "pnADDRESSTYPEID", DbType.Int32, _addressTypeID); db.AddInParameter(dbCommand, "pcADDRESSLINE1", DbType.String, _addressLine1); db.AddInParameter(dbCommand, "pcADDRESSLINE2", DbType.String, _addressLine2); db.AddInParameter(dbCommand, "pcCITY", DbType.String, _city); db.AddInParameter(dbCommand, "pnSTATEPROVID", DbType.Int32, (_state <= 0 ? DBNull.Value : (object)_state)); db.AddInParameter(dbCommand, "pcZIP", DbType.String, _zip); db.AddInParameter(dbCommand, "pnPRIMARYIND", DbType.Int32, _isPrimary ? 1 : 0); db.AddParameter(dbCommand, "pnObjectVersion", DbType.Int32, ParameterDirection.InputOutput, null, DataRowVersion.Default, _objectVersion); db.AddInParameter(dbCommand, "pcForceUpdate", DbType.String, (_isForceUpdate ? "Y" : "N")); db.AddInParameter(dbCommand, "pcUsername", DbType.String, BizHelper.UserName); db.ExecuteNonQuery(dbCommand);
MarkOld(); }
internal void DeleteSelf() { // if we're not dirty then don't update the database if (!this.IsDirty) return;
// if we're new then don't update the database if (this.IsNew) return;
Database db = DatabaseFactory.CreateDatabase("GenesisDB"); string spName = "ADDRESSP.DELETEADDRESST"; System.Data.Common.DbCommand dbCommand = db.GetStoredProcCommand(spName); db.AddInParameter(dbCommand, "pcUsername", DbType.String, BizHelper.UserName); db.AddInParameter(dbCommand, "pnID", DbType.Int32, _ID); db.ExecuteNonQuery(dbCommand);
MarkOld(); }
private void Fetch(SafeDataReader dr) { _ID = dr.GetInt32("ID"); _addressTypeID = dr.GetInt32("ADDRESSTYPEID"); _addressLine1 = dr.GetString("ADDRESSLINE1"); _addressLine2 = dr.GetString("ADDRESSLINE2"); _city = dr.GetString("CITY"); _zip = dr.GetString("ZIP"); _state = dr.GetInt32("STATE"); _country = dr.GetInt32("COUNTRY"); _isPrimary = dr.GetBoolean("PRIMARYIND");
MarkOld(); }
internal static void DeleteAddress(int parentID, int relationType) { Database db = DatabaseFactory.CreateDatabase("GenesisDB"); string spName = "ADDRESSP.DELETEADDRESSTLIST"; System.Data.Common.DbCommand dbCommand = db.GetStoredProcCommand(spName);
db.AddInParameter(dbCommand, "pnParentID", DbType.Int32, parentID); db.AddInParameter(dbCommand, "pnRelationTypeID", DbType.Int32, relationType); db.AddInParameter(dbCommand, "pcUserName", DbType.String, BizHelper.UserName); db.ExecuteNonQuery(dbCommand); }
internal static void DeleteAddress(int parentID, DBAddressRelationType relationType) { DeleteAddress(parentID, (int)relationType); }
private void Fetch() { try { Database db = DatabaseFactory.CreateDatabase("GenesisDB"); string spName = "ADDRESSP.GETADDRESST"; System.Data.Common.DbCommand dbCommand = db.GetStoredProcCommand(spName);
db.AddInParameter(dbCommand, "pnParentID", DbType.Int32, _parentID); db.AddInParameter(dbCommand, "pnRelationTypeID", DbType.Int32, _relationTypeID); db.AddInParameter(dbCommand, "pcUsername", DbType.String, UserName); dbCommand.Parameters.Add(new System.Data.OracleClient.OracleParameter("cur_OUT", System.Data.OracleClient.OracleType.Cursor, 2000, ParameterDirection.Output, true, 0, 0, "", DataRowVersion.Default, Convert.DBNull));
using (SafeDataReader dr = new SafeDataReader(db.ExecuteReader(dbCommand))) // Automatically closes the DataReader { if (dr.Read()) { Fetch(dr); } else MarkOld(); } } catch (Exception ex) { throw ex; } } #endregion
#region Methods
public static bool IsDuplicate(object target, RuleArgs e) { Address add = (Address)target; if (add.ParentCollection == null) return true;
foreach (Address ad in add.ParentCollection) { if (ad.ID != add._ID) { if (ad.AddressTypeID == add._addressTypeID && (String.Compare(ad.AddressLine1, add._addressLine1, true) == 0) && (String.Compare(ad.AddressLine2, add._addressLine2, true) == 0) && (String.Compare(ad.City, add._city, true) == 0) && ad.State == add._state && (String.Compare(ad.Zip, add._zip, true) == 0) && ad.Country == add._country) { e.Description = "Address already exists."; return false; } } }
return true; } #endregion
#region AddressTypeList public static AddressTypeList AddressTypes { get { if (!ApplicationCache.Contains("Address_AddressTypes")) { AddressTypeList addTypeList = AddressTypeList.GetList(); ApplicationCache.Add("Address_AddressTypes", addTypeList); return addTypeList; }
return (AddressTypeList)ApplicationCache.GetData("Address_AddressTypes"); } } #endregion AddressTypeList
#region Business Rules protected override void AddBusinessRules() { ValidationRules.AddRule(IntegerRequired, new BunchRuleArgs("AddressTypeID", "Address Type")); ValidationRules.AddRule(StringRequired, new BunchRuleArgs("AddressLine1", "Address Line 1")); ValidationRules.AddRule(StringRequired, new BunchRuleArgs("City", "City")); ValidationRules.AddRule(IntegerRequired, new BunchRuleArgs("State", "State")); ValidationRules.AddRule(StringRequired, new BunchRuleArgs("Zip", "Zip")); ValidationRules.AddRule(StringMaxLength, new BunchMaxLengthRuleArgs("AddressLine1", "Address Line 1", 40)); ValidationRules.AddRule(StringMaxLength, new BunchMaxLengthRuleArgs("AddressLine2", "Address Line 2", 40)); ValidationRules.AddRule(StringMaxLength, new BunchMaxLengthRuleArgs("City", "City", 30)); ValidationRules.AddRule(StringMaxLength, new BunchMaxLengthRuleArgs("Zip", "Zip", 10));
ValidationRules.AddRule(ValidateState, new RuleArgs("State")); ValidationRules.AddRule(IsDuplicate, new RuleArgs("IsValid")); }
public override void ValidatePrimary() { if (IsPrimary) { foreach (Address obj in ParentCollection) obj.IsPrimary = (obj.ID == ID); } }
private static bool ValidateState(object target, RuleArgs e) { if (((Address)target)._state == CONST_INVALID_STATE_ID) { e.Description = "State is invalid."; return false; } return true; }
#endregion }}

Thursday, October 11, 2007

Can't delete column from a table (SQL SERVER 2000)

I was working on Sql server 2000 which was migrated from older version to sql server 2000.

I have added a column to an existing table using the following query:

alter table test add col1 varchar(1)

And afterwards I wanted to delete that column. I have tried the following query for that

alter table [test] drop column [col1]

but its always giving me the following error message :

This query executed successfully.

'test' table

- Unable to modify table.

ODBC error: [Microsoft][ODBC SQL Server Driver][SQL Server]Line 2: Incorrect syntax near 'col1'.

 

Same error I was getting when I tried deleting the column from Enterprise Manager.

Resolution :

first run the following query & check the compatibility :

sp_dbcmptlevel databaseName

If the compatability level is 65, change it to 70 or 80 by using the following query:

sp_dbcmptlevel databaseName,70

 

Now the delete query will be executed without fail.