Friday, July 29, 2022

Jquery callback

 

A callback function is executed after the current effect is finished.

after the shadow is 100% complete


 $("button").click(function(){


  $("p").hide("slow", function(){

    alert("The paragraph is now hidden");

  });

});

JQuery button with function with HTML button get value with Class name

<script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js" type="text/javascript">
var value = $('.txtTest').val();
</script>

<input runat="server" id="txtTest" value="test" class="txtTest" />

JQuery button with function with HTML button set value by button ID

 <script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js">

    $(function(){
        $("#input1").val("Hello world");
    });
</script>
<input type="text" id="input1" />

</script>

JQuery get value and set value by ASP.NET textbox ID with ternary operator

 <script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js">


function test() {

         

         var recipient = $("#<%=txtTheoryHours.ClientID%>").val();

         

         var theoryHours = $('#<%=txtTheoryHours.ClientID %>').val() == '' ? 0 : $('#<%=txtTheoryHours.ClientID %>').val();

         var practicalHours = $('#<%=txtPracticalHours.ClientID %>').val() == '' ? 0 : $('#<%=txtPracticalHours.ClientID %>').val();

//to get the value

         var ojtHours = $('#<%=txtOJTHours.ClientID %>').val() == '' ? 0 : $('#<%=txtOJTHours.ClientID %>').val();

         var genericNOSHours = $('#<%=txtGenericNOSHours.ClientID %>').val() == '' ? 0 : $('#<%=txtGenericNOSHours.ClientID %>').val();

         var nsqfReimburseCourseDuration = parseInt(theoryHours) + parseInt(practicalHours) + parseInt(ojtHours) + parseInt(genericNOSHours);

//to set the value

         $('#<%=txt_NSQFReimburseCourseDuration.ClientID %>').val(nsqfReimburseCourseDuration);

         $('#<%=txt_NSQFcourseDuration.ClientID %>').val(parseInt(theoryHours) + parseInt(practicalHours));

        

     }


<script>

<asp:TextBox ID="txtTheoryHours" runat="server" MaxLength="4"  placeholder="Enter theory hours"

                    CssClass="form-control" onchange="test()"  OnTextChanged="txtTheoryHours_textChanged" ></asp:TextBox>




or we can use clientidmode to static and directly use txt id

 <asp:TextBox ID="txtPIPD" runat="server" ClientIDMode="Static"/>

javascript

 $(function () {

            $("#txtPIPD").datepicker({

                changeMonth: true,

                changeYear: true

            });

        });

Onchange textbox javascript with ASP.NET controls

<script language="javascript" type="text/javascript">

  function test() {

         debugger;

         var recipient = $("#txtTheoryHours");

         alert(recipient);


         var theoryHours = document.getElementById('<%=txtTheoryHours.ClientID %>').value == '' ? 0 : document.getElementById('<%=txtTheoryHours.ClientID %>').value;

         var practicalHours = document.getElementById('<%=txtPracticalHours.ClientID %>').value == '' ? 0 : document.getElementById('<%=txtPracticalHours.ClientID %>').value;

         var ojtHours = document.getElementById('<%=txtOJTHours.ClientID %>').value == '' ? 0 : document.getElementById('<%=txtOJTHours.ClientID %>').value;

         var genericNOSHours = document.getElementById('<%=txtGenericNOSHours.ClientID %>').value == '' ? 0: document.getElementById('<%=txtGenericNOSHours.ClientID %>').value;

         var nsqfReimburseCourseDuration = parseInt(theoryHours) + parseInt(practicalHours) + parseInt(ojtHours) + parseInt(genericNOSHours);


         document.getElementById('<%=txt_NSQFReimburseCourseDuration.ClientID %>').value = nsqfReimburseCourseDuration;

         document.getElementById('<%=txt_NSQFcourseDuration.ClientID %>').value = parseInt(theoryHours) + parseInt(practicalHours);


         

        // alert(theoryHours);

     }


</script>


<asp:TextBox ID="txtTheoryHours" runat="server" MaxLength="4"  placeholder="Enter theory hours"

                    CssClass="form-control" onchange="test()"  OnTextChanged="txtTheoryHours_textChanged" ></asp:TextBox>

Form HTML Page - Copy website disable - paste disable in website -Cut disable - Logout waiting (Loading....)

 <script type="text/javascript">

        function burstCache() {

            if (!navigator.onLine) {

                document.body.innerHTML = "Loading....";

                window.location = "../Logout.aspx";

            }

        }

    </script>

 <body onload="burstCache()">

    <form id="form1" runat="server" method="post" autocomplete="off" oncopy="return false;"

    onpaste="return false;" oncut="return false;" ondragstart="return false;" onselectstart="return false;">

<div>

</div>

<form>

<body>

Agile or Water fall and devops model or mythologies in software development life cycle -SDLC

 Devops: It is a mythology  that is having continuous integration and continuous delivery. It save money. 

 Devops is a set of practices that combines software development and IT operations. It aims to shorten the systems development life cycle and provide continuous delivery with high software quality

> Devops engineer do all the responsibilities of entire life cycle.

Planning> Analysis> Design> Develop>Testing> Deploy> Maintenance

continuous development

------------------------------

Agile:- In agile, No documentation working on softwares., continuous deployment, continuous delievery

Sample Database

Northwind Database


https://github.com/microsoft/sql-server-samples/tree/master/samples/databases


 https://github.com/microsoft/sql-server-samples/blob/master/samples/databases/northwind-pubs/instnwnd.sql

Thursday, July 28, 2022

SQL server (not equal to equal to) conditional operator

equal to condition 
SELECT * 
FROM table_name  
WHERE mod(column_name,2) = 0;
------------------------------
Not equal to condition 
SELECT * 
FROM table_name  
WHERE mod(column_name,2) <> 0; 

Case statement in where clause SQL Server (even or odd find number)

 SELECT max_student_allowed, max_student_allowed/2 AS Half_of_Max_Student, *, Total_Certified, Total_Placed, 

Total_Trained FROM VW_getInvoiceBatchDetails WHERE Training_Partner_id = 'ESDM-HR-TP-000379' and batch_code = 'batch-hr-20452-db'

AND Total_Placed>=(CASE WHEN max_student_allowed % 2 = 0

THEN ((max_student_allowed/2))

    ELSE ((max_student_allowed/2)+1)

END )


--------------------------------

Also we can use mod function for finding even and odd values


for even 
SELECT * 
FROM table_name  
WHERE mod(column_name,2) = 0;
------------------------------
for odd
SELECT * 
FROM table_name  
WHERE mod(column_name,2) <> 0; 

Error External table is not in the expected format, while uploading excel file in ASP.NET C#

 Use Firefox instead of Chrome

Wednesday, July 27, 2022

For loop in Excel VBA

 Dim i As Integer


For i = 1 To 6 Step 2
    Cells(i, 1).Value = 100
Next i

How to reset drop down list in ASP.NET C# or to select the select value in drop down

 protected void DDL_KIA_OnSelectedIndexChanged(object sender, EventArgs e)

    {

        //New Code Add on 15072020

        DDL_FinYear.SelectedIndex = -1;

        DDL_Course.SelectedIndex = -1;

        DDL_Batch.SelectedIndex = -1;

        DDL_Status.SelectedIndex = -1;


        //BindYear();

    }



<asp:DropDownList ID="DDL_Status" Width="150px" runat="server" AutoPostBack="true" CssClass="form-control input-sm" OnSelectedIndexChanged="DDL_Status_OnSelectedIndexChanged">

                        <asp:ListItem Value="-1">-- Select --</asp:ListItem>

                            <asp:ListItem Value="5">New Request</asp:ListItem>

                            <asp:listitem Value="0">Requested to KIA</asp:listitem>

                            <asp:listitem Value="2">Approved</asp:listitem>

                            <asp:listitem Value="3">Rejected</asp:listitem>

                        </asp:DropDownList>

Tuesday, July 26, 2022

How to create batch file for opening multiple programs in window 10 with two chrome profile batch file or powershell

 



START C:\"Program Files\Microsoft Visual Studio"\2022\Community\Common7\IDE\devenv.exe


start C:\"Program Files (x86)\Microsoft SQL Server Management Studio 18"\Common7\IDE\Ssms.exe


start C:\"Program Files"\Google\Chrome\Application\chrome.exe --profile-directory="Profile 21" "gmail.com" "mail.live.com" "sonipat.gov.in"  "panipat.gov.in" "karnal.gov.in" "https://www.aiims.edu/en/notices/recruitment/aiims-recruitment.html"  "http://www.nhmharyana.gov.in/page?id=37" "https://hartronservices.com/advertisement/" "https://iasri.icar.gov.in/Emp_vacancy.aspx/" "https://www.becil.com/vacancies" "https://www.iari.res.in/index.php?option=com_content&view=article&id=706&Itemid=471" "https://icar.org.in/content/vacancy-0"


start C:\"Program Files"\Google\Chrome\Application\chrome.exe --profile-directory="Profile 18" "email.gov.in" "localhost" "esdm-skill.deity.gov.in"





You can find (--profile-directory="Profile 18")  this on 

>Right click on Chrome

> Click on Properties

> Find this on target


How to create user chrome shortcut icon

 > Click on Menu Icon left to "settings" in chrome

> Click on 'Manage profile' Icon  right to "other Profile"

> Click on Profile settings icon

> Click on Edit and scroll down

> You will see "Create desktop icon" toggle button

> Also you can Customize profile or Change name in this settings.

Voice Typing in Google docs

> Open google Docs(docs.google.com)

> Click on Tools and click on Voice Typing

Syntax of SQL script Stored procedure View and Tables

1) Drop Procedure

2) Create Procedure

3) Alter Procedure



Thursday, July 21, 2022

Wednesday, July 20, 2022

How to auto insert values in Excel VBA with for loop by macro(event)

 Sub test()

Dim rng As Range, cell As Range


Set rng = Range("A1:A10")



For Each cell In rng
cell.Value = cell.Value * cell.Value
Next cell
End Sub

 

or change Set rng = Range("A:A") 

for lakhs of values

 

or

 

change 

 

Set rng = Selection

How to find value at which cell in Excel VBA IF else condition for loop

 

Public Sub LoopCells()

Dim c As Range

For Each c In Range("A1:A10")
    If c.Value = "FindMe" Then
      MsgBox "FindMe found at " & c.Address
    End If
Next c

End Sub
 
 
Public Sub LoopColumn()

Dim c As Range

For Each c In Range("A:A")
    If c.Value = "FindMe" Then
      MsgBox "FindMe found at " & c.Address
    End If
Next c

End Sub 

How to create button in Excel and Click event(macro) in it VBA

 > Open Exce

> Click on Developer

>Click on Insert

>Click on Button

> Right click on it and Click on assign macro or click on edit macro

and paste below code

macro below

Sub Button5_Click()
Range("A1").Value = "hello"
End Sub

How to create button in Excel with Click event(macro) VBA

 https://www.excel-easy.com/vba/examples/macro-recorder.html

What are macros in Excel VBA

 We can say macros are events(Click event) or functions just like asp.net.

How to view, create and record and edit and Delete macros in Excel VBA

To view Macro

>Open excel

>Click on Developer

> Click on Macros

> Select the macro and click on run 


Record Macro

 > Open Excel

> Click on 'Record Macro'

> Enter the name of the macro

> And click on OK

> Now enter the values in row or do any thing (create button)

> Now click on stop recording

> Now click on macros and you can run the macro 

 

Create new macro with VB

>Open excel

>Click on Developer

>Click on Visual basic

>Under 'Microsoft excel objects' 

>Click on Sheet 1

> Write the below code

Sub test()
    ActiveCell.FormulaR1C1 = "12"
    Range("A2").Select
    ActiveCell.FormulaR1C1 = "34"
    Range("A3").Select
End Sub

> And now click on Macros and click on Run


Edit Macro

>Open excel

> Click on Developer

>Click on Macros (test 1)and Click on Run 


Delete Macro

>Open excel

> Click on Developer

>Click on Macros (test 1)and Click on Delete







ASP.NET SQL Script performa

 First Drop procedure


Create procedure


Alter Procedure

Chrome and firefox Task manager

 >Click on settings

> Click on More tools

>Click on task manager

Firefox Zoom option for websites

 > Open Firefox

> Click on settings

>Click on zoom and click on default zoom to 110% or 125%

and there are other options such as font change etc.

Firefox dark mode or dark mode for all websites

 >Open firefox

> Click on settings

>Click on Firefox settings and Click on Dark mode

 

or You can go to themes and change the theme


or you can use extensions below:-

https://addons.mozilla.org/en-US/firefox/addon/darkreader/

https://addons.mozilla.org/en-US/firefox/addon/night-eye-dark-mode/

Tuesday, July 19, 2022

Friday, July 15, 2022

100% disk storage memory in task manager windows 10 scan disk (fast performance) - better performance - speed fast

 https://whatsabyte.com/fix-100-disk-usage-windows-10/


Or you can use paging (reset virtual memory)

>Right Click on 'MY Computer'

>Go to Properties

> Go to 'Advanced System Settings'

>Click on 'Advanced' tab

> Click on settings

>Click on Advanced

>Click on Change

Factorial of number C# ASP.NET Recursion

 using System;

namespace FactorialExample

{

    class Program

    {

        static void Main(string[] args)

        {

            Console.WriteLine("Enter a number");

            int number = Convert.ToInt32(Console.ReadLine());

            long fact = GetFactorial(number);

            Console.WriteLine("{0} factor

Thursday, July 14, 2022

How to create and clear cache in ASP.NET C# Or in IIS

 

1. How to clear cache in asp.net C# (clear specified cache)

string cacheKey = "TestCache";

//Add cache
       Cache.Add(cacheKey"Cache content"nullDateTime.Now.AddMinutes(30), TimeSpan.Zero, CacheItemPriority.High, null);

Cache.Remove(cacheKey);//C# clear cache

 

2. How to clear all caches in asp.net C#

IDictionaryEnumerator allCaches = HttpRuntime.Cache.GetEnumerator();

while (allCaches.MoveNext())
       {
              Cache.Remove(allCaches.Key.ToString());
       }
       Response.Write("Remove all caches!");


OR

>In IIS Goto HTTP Responses

>Click on 'set common headers'

> Click on 'Expire web content' and click OK

reference:- https://mohamedradwan.com/2010/12/26/caching-static-files-js-files-css-and-images-in-iis-7/



Encryption and decryption of password in ASP.NET C#

 ASPX CODE

<%@ Page Title="" Language="C#" MasterPageFile="~/Common.master" AutoEventWireup="true" CodeFile="DecryptPassword.aspx.cs" Inherits="DecryptPassword" %>


<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">

        

</asp:Content>

Wednesday, July 13, 2022

How to convert PDF file into text

> Use PDF writer


or 

> GOto https://online2pdf.com/ and convert PDF for searchable PDF.

PDF in iframe C# ASP.NET Popup panel

 <asp:Panel ID="panelOverlay2" runat="server" CssClass="Overlay" Visible="false">

            </asp:Panel>

            <asp:Panel ID="panelPopUpPanel2" runat="server" CssClass="PopUpPanel" Visible="false"

                Style="left: 5%; right: 5%; top: 100px">

                <asp:Panel ID="panelPopUpTitle2" runat="server" Style="width: 100%; height: 20px; text-align: right;">

Tuesday, July 12, 2022

System.ComponentModel.Win32Exception: The wait operation timed out

//da.SelectCommand.CommandTimeout = 0;  set this in c#

--------------------------------

run command prompt with administrator 

Go to c:\windows\system32


run below command

netsh int ip reset c:\resetlog.txt

netsh winsock reset

ipconfig /flushdns


or disable or enable your internet

or goto network reset and restart now

HTML table with 3 columns C# ASP.NET file upload with link button

 <table cellspacing="1" cellpadding="6" width="100%" class="listTable persist-area">

                


                <tr>

                     <td align="left" width="19%">Attendance Upload <br />(PDF with size up to 10 MB):<asp:Label ForeColor="Red"

                        runat="server" ID="Label34">*</asp:Label>&nbsp;

                    </td>

                   

How to partitioning of disk in Disk Management in window 10

 > Go to 'disk management' in control panel or write  “diskmgmt.msc” in run

Click the below link

https://pcsupport.lenovo.com/in/en/products/laptops-and-netbooks/legion-series/legion-y540-17irh-pg0/solutions/ht503851-how-to-partition-your-hard-disk-drive-in-windows-7-and-windows-10?ef_id=Cj0KCQjwlK-WBhDjARIsAO2sErSOlQW7aFuvkQ38SmLAoKHkDgPSL8fo2DkARVOAIhJNk49udNLDWAkaAjCBEALw_wcB:G:s&s_kwcid=AL!8093!3!575012637759!!!g!!&cid=in:sem:dfp9vn&gclid=Cj0KCQjwlK-WBhDjARIsAO2sErSOlQW7aFuvkQ38SmLAoKHkDgPSL8fo2DkARVOAIhJNk49udNLDWAkaAjCBEALw_wcB

How to show MY computer on windows 10

 > Right click on Desktop

> Click on themes

> Click on 'Desktop icon settings'

> Check/uncheck checkbox 'Computer'

Monday, July 11, 2022

How to add two numbers in javascript

 const num1 = 5;

const num2 = 3;

// add two numbers
const sum = num1 + num2;

// display the sum
console.log('The sum of ' + num1 + ' and ' + num2 + ' is: ' + sum);

Javascript get value of asp.net textbox

 document.getElementById('<%=txtTheoryHours.ClientID %>').value