Thursday, December 3, 2020

How to Shrink SQL Server Database Log File Size using DBCC Command

 

 

How to Shrink SQL Server Database Log File Size using DBCC Command

you must take a full backup of your database before executing the following: 

 

ALTER DATABASE <YOUR DATABASE NAME>
SET RECOVERY SIMPLE
GO
DBCC SHRINKFILE (<YOUR DATABASE LOG FILE NAME>, TARGET SIZE IN MB)
GO
ALTER DATABASE <YOUR DATABASE NAME>
SET RECOVERY FULL 

 

 

Wednesday, April 24, 2019

Reset Windows 2008 R2 Server Admin password


To Reset Administrator Password in Windows 2008 R2 Server is a reboot and a few steps:
  • Boot from the Micrsoft Windows Server 2008 DVD
  • From the Install Windows menu, click “Next”.
  • Select “Repair your computer”
  • In the System Recovery Options, select the Operating System instance that you wish to repair and click “Next”.
  • Select “Command Prompt”. The
  • At the command prompt, run the following commands:c:
    cd windows\system32
    ren Utilman.exe Utilman.exe.old

    copy cmd.exe Utilman.exe
  • Reboot the server allowing Windows to load as normal
  • At the logon screen, press Windows Key + U.
  • As the command prompt, enter the following command: 
    • net user administrator New_PASSWORD
  • Log into the server with New_PASSWORD
  • Reboot into the repair command prompt
c:
cd windows\system32
del utilman.exe
copy Utilman.exe.old utilman.exe
Reboot and enjoy

Thursday, May 10, 2018

ASP .NET AJAX - Maintain Or Set Page Scroll Position After Asynchronous Postback In ASP.NET AJAX



Now just add the below JavaScript code to the relevant section of your Web Page.


  1. <script type="text/javascript">  
  2.     var xPos, yPos, needScroll;  
  3.     var prm = Sys.WebForms.PageRequestManager.getInstance();  
  4.     prm.add_beginRequest(BeginRequestHandler);  
  5.     prm.add_pageLoaded(EndRequestHandler)  
  6.   
  7.     function BeginRequestHandler(sender, args) {  
  8.         xPos = 0;  
  9.         yPos = window.pageYOffset || document.documentElement.scrollTop;  
  10.     }  
  11.   
  12.     function EndRequestHandler(sender, args) {  
  13.         if (needScroll) {  
  14.             window.setTimeout("window.scrollTo(" + xPos + "," + yPos + ")", 100);  
  15.         }  
  16.     }  
  17. </script>  


After adding the above code at page script Tag on your code behind you need to add the below code at your .cs page to call the Javascript function after page completes its rendering after postback.


ScriptManager.RegisterStartupScript(this.Page, this.Page.GetType(), "ScrollTo", "var needScroll = true;", true);

Monday, May 15, 2017

How to fix ORA-01502 index or partition of such index is in usable state




If you get the error How to fix ORA-01502: index or partition of such index is in usable state in Oracle. It is possible that an index is broken from a table.


To fix this error, you can do the following:

rebuild the index with the following SQL command:


ALTER INDEX your_index_name REBUILD;



Thursday, May 11, 2017

Response.Headers -->This operation requires IIS integrated pipeline mode.



Try the following Solution:


Your Application Pool is in classic mode but your Application need integrated mode to fire. change it to Integrated Mode:

  1. Open IIS Manager
  2. Application Pool
  3. Select pool that your app are run in it (in case same app pool is used in multiple published web applications, in that case create a new appl. pool for this web application)
  4. In right panel select Basic Setting
  5. Manage Pipeline Mode change to Integrated



Sunday, April 2, 2017

Pen drive show empty even when data exists



Pen drive show empty even when data exists

Check if the files are not in hidden mode.

Click on "Start" -->Run --> Type cmd and press Enter.

Here I assume your pendrive drive letter as H:

Enter this command.

attrib -h -r -s /s /d h:\*.* --> Press Enter




Friday, February 17, 2017

To remove all debug breakpoints in Android Studio


To remove all debug breakpoints in Android Studio, follow the steps given below:



  1. Ctrl + Shift + F8 (open Breakpoints dialog)
  2. Ctrl + A (select all breakpoint)
  3. Alt + Delete (remove selected breakpoints)
  4. Enter (confirm)