Monday, December 28, 2009

Get Randow Row from a table, Sql-server

SELECT Top 1 *
FROM TableName
ORDER BY NewID()

Thursday, December 24, 2009

MS SQL-Server, Recover Database from suspect Mode

Steps to recover MS SQL-server Database from "suspect "mode:
EXEC sp_resetstatus 'DatabaseName';
ALTER DATABASE DatabaseName SET EMERGENCY
DBCC checkdb('DatabaseName')
DBCC CHECKCATALOG('DatabaseName')
ALTER DATABASE DatabaseName SET SINGLE_USER WITH ROLLBACK IMMEDIATE
DBCC CheckDB ('DatabaseName', REPAIR_ALLOW_DATA_LOSS)
ALTER DATABASE DatabaseName SET MULTI_USER
ALTER DATABASE DatabaseName SET ONLINE;

Ajax CalendraExtender Hides Behind other controls

We can solve the problem of hiding CalenderExtender by increasing the z-index

Example:-

Add Javascript to the CalendraExtender event OnClientShownLike OnClientShown="onCalenderShown"

Javascript function:-

function onCalenderShown(sender,args)
{
sender._popupBehavior._element.style.zIndex=150002;
}