Monthly Archives: November 2011

Avoiding Deadlock Transaction Errors by Using ROWLOCK Hint in T-SQL

When updating a single row data in a table, it may take a nasty while if the table is big and you have a condition in a WHERE clause on a column that is not indexed. In this case SQL … Read More »»»

Posted in MSSQL | Tagged , , , , , , , , , , , , | 1 Comment

How to Use NOLOCK and ISOLATION LEVEL to Optimize T-SQL Query Performace

In this article, we will discuss how a NOLOCK hint can help improve performance of queries. Suppose you have a table: CREATE TABLE Users ( UserId INT PRIMARY KEY IDENTITY(1, 1) NOT NULL, FirstName NVARCHAR(50) NOT NULL, LastName NVARCHAR(50) NOT … Read More »»»

Posted in MSSQL | Tagged , , , , , , , , , , , , | 1 Comment

How to Access Your Model Data in .NET MVC With Razor Engine for Beginners

It may be a little frustrating to start your first MVC application using Razor engine, especially if you have never used it before. Here are some interesting pointers for beginners: First, when you created your first solution, Visual Studio will … Read More »»»

Posted in MVC | Tagged , , , , , , , | Leave a comment

Saving Bulk Modified or Deleted SQL Database Data for Recovery

Sometimes you need to modify or remove data in bulk in a SQL database. Whatever the reason is, it is always a good practice to store such changes so that if something goes wrong you would be able to restore … Read More »»»

Posted in MSSQL | Tagged , , , , , , , , , | Leave a comment

Create a SQL CLR Stored Procedure Using .NET (C# Example)

T-SQL is limited in its functions and getting the results you need sometimes becomes very complex and the statements used consequently hard to decipher. With SQL Server 2005, Microsoft introduced CLR (Common Language Runtime) technology which allows you to use … Read More »»»

Posted in C# | Tagged , , , , , , , , , , , , | Leave a comment

What is CLR, How to Check If It is Enabled and How to Enable It

CLR stands for Common Language Runtime and is a technology developed by Microsoft that allows you to use managed .NET code in SQL Server environment. In other words, you can write your stored procedures, triggers and user-defined functions, aggregates and … Read More »»»

Posted in MSSQL | Tagged , , , , , , | 1 Comment

How to Allow Only Numbers in HTML TextBox Using Javascript

Sometimes you want to constrain what a user can enter in a textbox input on a page. This article shows you an easy way to do it with javascript and explains how it works. In short, you want to trap … Read More »»»

Posted in Javascript | Tagged , , , , , , , , , | 1 Comment

How to Implement a Superscript or Subscript Class with CSS

If you need to add a superscript or subscript text to your paragraph, you can surely use the <sup> and <sub> tags. There is one major problem with it – the line height. Look at the code below: <p> No … Read More »»»

Posted in CSS | Tagged , , , , , | Leave a comment

Microsoft .NET MVC Framework: How to Use Named Anchors (URL Hash Links) in Html.ActionLink

In HTML you can specify which part of the page you want to scroll to if a user clicks on a page using the hash symbol (#) like this: My Topic … Given how MVC works differently and the URL … Read More »»»

Posted in MVC | Tagged , , , , , , , , , , | Leave a comment

Microsoft .NET MVC: How to Use Hyphens in URLs for Conrollers and Actions

Once you created your MVC project, surely you can use underscores in in the names of your controllers and actions. Using hyphens in URLs, however, can make a difference for when your site is discovered by search engines. When you … Read More »»»

Posted in MVC | Tagged , , , , , , , , , , , | 2 Comments