Infolink

 

Search This Blog

Oct 7, 2012

How to avoid deadlocking on your SQL Server


Deadlock:

Deadlocking occurs when two user processes have locks on separate objects and each process is trying to acquire a lock on the object that the other process has. When this happens, SQL Server ends the deadlock by automatically choosing one and aborting the process, allowing the other process to continue. The aborted transaction is rolled back and an error message is sent to the user of the aborted process. Generally, the transaction that requires the least amount of overhead to rollback is the transaction that is aborted.


Oct 3, 2012

The major difference between convert.ToString() and ToString() is that,

convert.ToString() handles null but ToString() does not handles null.

Please see below two set of code:

This code will run successfully, no exception will be raised for that:

    string name = null;

    string abc = Convert.ToString(name);

Below code will give an exception, unhandled Exception:NullReferenceException

    string name = null;

    string abc = name.ToString();
Related Posts Plugin for WordPress, Blogger...