Wednesday, July 18, 2012

Sunday, June 3, 2012

Backup all Databases


DECLARE @DBName varchar(255)

DECLARE @DATABASES_Fetch int

DECLARE DATABASES_CURSOR CURSOR FOR
    select
        DATABASE_NAME   = db_name(s_mf.database_id)
    from
        sys.master_files s_mf
    where
       -- ONLINE
        s_mf.state = 0 

       -- Only look at databases to which we have access
    and has_dbaccess(db_name(s_mf.database_id)) = 1 

        -- Not master, tempdb or model
    and db_name(s_mf.database_id) not in ('Master','tempdb','model')
    group by s_mf.database_id
    order by 1

OPEN DATABASES_CURSOR

FETCH NEXT FROM DATABASES_CURSOR INTO @DBName

WHILE @@FETCH_STATUS = 0
BEGIN
    declare @DBFileName varchar(256)    
    set @DBFileName = datename(dw, getdate()) + ' - ' + 
                       replace(replace(@DBName,':','_'),'\','_')

    exec ('BACKUP DATABASE [' + @DBName + 'TO  DISK = N''c:\db backup\' + 
        @DBFileName + ''' WITH NOFORMAT, INIT,  NAME = N''' + 
        @DBName + '-Full Database Backup'', SKIP, NOREWIND, NOUNLOAD,  STATS = 100')

    FETCH NEXT FROM DATABASES_CURSOR INTO @DBName
END

CLOSE DATABASES_CURSOR
DEALLOCATE DATABASES_CURSOR

Sunday, May 20, 2012

GET /DevMgmt/DiscoveryTree.xml HTTP/1.1

GET /DevMgmt/DiscoveryTree.xml HTTP/1.1
Host: 127.0.02:8080

To remove above extra page after printing
follow these steps


Goto Printer Properties -> Device Settings
Open "Installable Options"
Disabled the "printer Status Notification"

Wednesday, April 18, 2012

Visual Studio toolbox items not showing


01 - Close Visual Studio
02 - Search *.tbd inside “C:\Documents and Settings\[UserName]\Local Settings\Application Data\Microsoft\VisualStudio” & delete them

Monday, March 19, 2012

Removing Smart Fortress


01 - Download
http://download.bleepingcomputer.com/reg/FixExe.reg
http://download.bleepingcomputer.com/grinler/iExplore.exe
and put these files in C:\ root folder



02 - Login in safe mode from your infected user.
Execute FixExe.reg from C:\
Execute iExplore.exe from C:\

Execute again FixExe.reg from C:\
Reboot in normal mode


03 - Download a good security program and clean up the mess, I am using Microsoft Security Essentials it is free and good.

Thursday, March 1, 2012

Sunday, January 29, 2012

Desktop IP for Windows CE or Windows Mobile when working without network

My Environment
OS: Windows 7
DB Server: SQL Server 2008 R2 (Default Instance)
Connectivity through: Windows Mobile Device Center
Application Developed in: Visual Studio 2008



For Windows CE
Desktop IP: 192.168.55.100
Device IP: 192.168.55.101

For Windows Mobile
Desktop IP: 169.254.2.2
Device IP: 169.254.2.1



Connection string inside my
Windows CE Project
"Data Source=192.168.55.100,1433;Initial Catalog=MyDB;Persist Security Info=True;User ID=sa;Password=MyPassword;"


Windows Mobile Project
"Data Source= 169.254.2.2,1433;Initial Catalog=MyDB;Persist Security Info=True;User ID=sa;Password=MyPassword;"