Monday, June 16, 2014

How to solve problem, An exception occurred while processing your request. Additionally, another exception occurred while executing the custom error page for the first exception. The request has been terminated.

When saw this error, go to web.config file, disable the customer error. Then you will see the real error.   Set to RemoteOnly if in the production environment, so only real error in local.
<customErrors mode="Off" >


Reference
http://msdn.microsoft.com/en-us/library/h0hfz6fc(v=vs.85).aspx

Friday, June 6, 2014

How to get list of div that contains specific class name in Html Agility?

            var DivListContainSpeciicClassName = htmlDoc.DocumentNode.Descendants("div").Where(
                d => d.Attributes.Contains("class")
                &&
                d.Attributes["class"].Value.Contains("cssClassName"));

Wednesday, June 4, 2014

How to kill all current connections to a database in SQL Server ?

In case of you want to restore an database.

There are many ways to do so.
See link on Stackoverflow
http://stackoverflow.com/questions/11620/how-do-you-kill-all-current-connections-to-a-sql-server-2005-database


Or there is another simple way:
1. In SQL Server studio, click Activity Monitor button
2. Filter by database
3. Right click to kill all of connection to that database