How we can prevent sql database from locking without usin nolock, readpast and readcommnited.
[Edit: more information from comments]
why is nolock not appropriate in your case?
For Example, I have a table Test. It contains all the information realted to each and every transaction. This table is used by all the employee. Suppose, when i am trying to fetch records from this table and same time some other transaction (Insert, update or delte) is in pogress. Then nolock will not provide exact records from this table. Thats why i am looking for some other way to select records. I have already used nowait, setlocktimeout, nolock, readcommited but it's not giving me correct details.
Why don't you just use IsolationLevel.Serializable and let the locks happen?
Suppose, i have a query and it's taking aroung 70 second to complete a transaction but inmean while other users reqeusted 10-15 request to complete transaction on same table. After 70 sec, all other transction executed succesfully but i got 3-4 deadlock error.
[/Edit //manchanx]