How to kill database in use process for restoration?

Read more about How to kill database in use process for restoration? article

I recently installed SQL 2008 on my machine and once I tried to restore a database, it failed as it complaint as the database was currently in use. In SQL 2005, we normally go to activity monitor to kill the process but this is a little different in SQL 2008. The easiest solution now is to run this little query.

How to check if Constraint exist

Read more about How to check if Constraint exist article

A very useful statement to check if a constraint exists before do something to it. Note, we can never edit a constraint before deleting it and re-create. SELECT * FROM INFORMATION_SCHEMA.TABLE_CONSTRAINTS WHERE CONSTRAINT_SCHEMA='dbo' AND CONSTRAINT_NAME='FK_37_Page_FK' AND TABLE_NAME='PageContent'

DataBinder.Eval: 'System.Data.DataRow' does not contain a property

Read more about DataBinder.Eval: 'System.Data.DataRow' does not contain a property  article

For some reason, DataBinder.Eval(Container.DataItem, "id") will not work in li tag within the item template of a repeater. I had to use this: ((System.Data.DataRow)Container.DataItem)["id"].ToString()

Some basic LinQ to SQL syntax

Read more about Some basic LinQ to SQL syntax  article

Have been trying to use Telerik Open Access ORM for the core framework. Finally have the basic structure setup. With having business objects layer, persistant classes and data access layer seperated, the web app itself could just communicate with the business objects, which then calls to persistant classes and data access layer.

Commonly Used SQL queries

Read more about Commonly Used SQL queries article

These are some of the commonly used SQL queries at work, just to note them down for easier access. To add a contraint (foreign key): alter table pro_product add constraint FK_53_PRO_Category_FK foreign key (PRO_Category_FK) references PRO_Category(Id) on delete cascade