Thursday 28 December 2017

1. Download MongoDB from here
2. Install the MongoDB using "Custom" and set the path to C:\MongoDB
3. After install is completed, open "Command Prompt" as "Administrator"
4. Issue the following command to create folder for databases and logs
    C:\MongoDB>md log
    C:\MongoDB>md data\db
5. Navigate to C:\MongoDB\Bin and run the following command
    mongod --directoryperdb --dbpath C:\MongoDB\data\db --logpath C:\MongoDB\log\mongo.log --logappend --rest --install
6. Run the service:
  C:\MongoDB\Bin>net start MongoDB
7. Type "mongo.exe" to open the shell
8. Useful commands:
cls : clear screen
show dbs : show the list of databases
use customers : create database 'customers' and switch to it
db : give the current database name
9. Assign role to database
db.createUser ({
user: "admin",
pwd: "admin",
roles: ["readWrite","dbAdmin"]
    });


MongoDB manual and reference: click here
MongoDB Download centre: click here


Monday 11 December 2017

Windows 10 100% disk usage in Task Manager

Create AJAX Modal

On the page:

<style>
  .modalPopup
  {
    background-color: #FFFFFF;
    border-width: 3px;
    border-style: solid;
    border-color: black;
    padding-top: 10px;
    padding-left: 10px;
    padding-right: 10px;
    min-width: 300px;
    min-height: 120px;
  }
</style> 

<asp:LinkButton ID="lnkDummy" runat="server"></asp:LinkButton>
<cc1:ModalPopupExtender 
    ID="ModalPopupExtender1" 
    BehaviorID="mpe" 
    runat="server"
PopupControlID="pnlPopup" 
    TargetControlID="lnkDummy" 
    BackgroundCssClass="modalBackground">
</cc1:ModalPopupExtender>

<asp:Panel 
    ID="pnlPopup" 
    runat="server" 
    CssClass="modalPopup" 
    Style="display: none; 
    overflow:auto; 
    max-height: 600px;">
  <div>
    <b runat="server" 
       id="modalHeader" 
       style="font-weight:600; 
       font-size:18px;">
    </b>
  </div>

  <hr />

  <div>
<div runat="server" 
       id="modalContent" 
       style="font-size: 14px"> 
    </div>

    <br /> <br />
    <asp:Button ID="btnHide" 
            runat="server" 
            Text="OK" 
            OnClientClick="return HideModalPopup()" />

    <br /> <br />
  </div>
</asp:Panel>

<script type="text/javascript">
  function ShowModalPopup() {
$find("mpe").show();
return false;
}
function HideModalPopup() {
$find("mpe").hide();
return false;
}
</script>



Call from code behind:

public void DisplayMessage(string header, string body)
{
modalHeader.InnerHtml = header;
modalContent.InnerHtml = body;
  ModalPopupExtender1.Show();
}

Sunday 10 December 2017

Windows 10 Disable Delay Time in Launching Startup Programs

Windows 10 delays on load and startup for few second. To resolve this issue:

  1. Open Windows Registry Editor: Windows + R > regedit
  2. Navigate to: HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer
  3. Under Explorer key, create a new key and set its name as Serialize
  4. Select Serialize key and in right-side pane, create a new DWORD StartupDelayInMSecand set its value to 0 to disable startup delay time:
  5. Close Registry Editor and restart your computer to take effects.


Upgrade Windows 11 Home to Windows 11 Pro

Disable internet connection (Wi-Fi, Internet, etc.) Change the product key using the following Generic product key:                     VK7J...