Tuesday, 3 March 2020

Redirect to another page using java script in asp.net


Redirect to another page using java script in asp.net 


 <input type="text" id="txtsearch" autocomplete="off" class="search_input" placeholder="Search"
                    required="required">//this is textbox
                <button class="search_button" onclick="myid();">//this i my button
                    <i class="fa fa-search" aria-hidden="true"></i>

                </button>
<script>
        function myid() {
            var b = document.getElementById("txtsearch").value;
          
            document.write("");
            setTimeout('Redirect()', 0000);
            window.location.href = "SearchProduct.aspx?PID=" + b, true;
        }
    </script>

I hope this will helpful for you

Friday, 28 February 2020

How to get MAC Address in asp.net

 How to get MAC Address in asp.net

  string MACAdd = GetMACAddress();

  public string GetMACAddress()
    {
        string macAddresses = "";

        foreach (System.Net.NetworkInformation.NetworkInterface nic in System.Net.NetworkInformation.NetworkInterface.GetAllNetworkInterfaces())
        {
            if (nic.OperationalStatus == System.Net.NetworkInformation.OperationalStatus.Up)
            {
                macAddresses += nic.GetPhysicalAddress().ToString();
                break;
            }
        }
        return macAddresses;
    }

I got macaddress of my pc using this 

Monday, 24 February 2020

Zoom In Image Effect In asp.net

Zoom In Image Effect In asp.net

https://codepen.io/kw7oe/pen/mPeepv

Quick CSS snacks for Image hover-zoom effects

Quick CSS snacks for Image hover-zoom effects



view above link 

How to avoid/disable mouse right click on my page

How to avoid/disable mouse right click on my page


Use below code this will helpful for you
<!DOCTYPE html>
<html>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
<script>
$(document).ready(function(){
   $(document).bind("contextmenu",function(e){
      return false;
   });
});
</script>
</head>
<body>

<p>Right click is disabled on this page.</p>

</body>
</html>

Tuesday, 24 December 2019

How to Delete duplicate rows from table in sql


How to Delete duplicate rows from table in sql server

WITH cte AS (
    SELECT 
Barcode,
        ROW_NUMBER() OVER (
            PARTITION BY 
                Barcode
            ORDER BY 
               Barcode
        ) row_num
     FROM 
        Isuued_Product_DetailsLog
)
DELETE FROM cte
WHERE row_num > 1;


I hope this will help to you

Saturday, 14 December 2019

how to use if else condition in sqlserver



How to use if else in sqlserver

This is my code  you can see below:
I hope this will help full to you

SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO

ALTER procedure [dbo].[CCISales_Groupwise]

@From varchar(50),
@To varchar(50),
@Exid varchar(50),
@ExName varchar(50)
as
begin
if @Exid!='All'
Begin
select distinct  cdp.Exhibition_Id,cdp.Exhibition_Name, convert(Varchar(50),cdp.Added_On,103) AS dates,CDP.GroupMode,
(SELECT SUM(Product_Total) FROM CCISold_Product_Details WHERE GROUPMODE=CDP.GROUPMODE and convert(Varchar(50),Added_On,103)=convert(Varchar(50),cdp.Added_On,103) and Exhibition_Id like case when @Exid='All' then '%%' else '%'+@Exid end and Exhibition_Name like case when @ExName='All' then '%%' else '%'+@ExName end
)AS PRODUCT,(SELECT COUNT(*) FROM CCISold_Product_Details WHERE GROUPMODE=CDP.GROUPMODE and convert(Varchar(50),Added_On,103)=convert(Varchar(50),cdp.Added_On,103) and Exhibition_Id like case when @Exid='All' then '%%' else '%'+@Exid end and Exhibition_Name like case when @ExName='All' then '%%' else '%'+@ExName end
)AS Qty  from CCISold_Product_Details AS CDP where Exhibition_Id like case when @Exid='All' then '%%' else '%'+@Exid end and Exhibition_Name like case when @ExName='All' then '%%' else '%'+@ExName end
group by Exhibition_Id, Exhibition_Name,convert(Varchar(50),cdp.Added_On,103),CDP.GroupMode
End
Else
begin
select distinct 
 convert(Varchar(50),cdp.Added_On,103) AS dates,CDP.GroupMode,
(SELECT SUM(Product_Total) FROM CCISold_Product_Details WHERE GROUPMODE=CDP.GROUPMODE and convert(Varchar(50),Added_On,103)=convert(Varchar(50),cdp.Added_On,103) and Exhibition_Id like case when @Exid='All' then '%%' else '%'+@Exid end and Exhibition_Name like case when @ExName='All' then '%%' else '%'+@ExName end
)AS PRODUCT,(SELECT COUNT(*) FROM CCISold_Product_Details WHERE GROUPMODE=CDP.GROUPMODE and convert(Varchar(50),Added_On,103)=convert(Varchar(50),cdp.Added_On,103) and Exhibition_Id like case when @Exid='All' then '%%' else '%'+@Exid end and Exhibition_Name like case when @ExName='All' then '%%' else '%'+@ExName end
)AS Qty  from CCISold_Product_Details AS CDP where Exhibition_Id like case when @Exid='All' then '%%' else '%'+@Exid end and Exhibition_Name like case when @ExName='All' then '%%' else '%'+@ExName end
group by convert(Varchar(50),cdp.Added_On,103),CDP.GroupMode
end
--select distinct @From as frd,@To as Tod, cdp.Exhibition_Id,cdp.Exhibition_Name, convert(Varchar(50),cdp.Added_On,103) AS dates,CDP.GroupMode,
--(SELECT SUM(Product_Total) FROM CCISold_Product_Details WHERE GROUPMODE=CDP.GROUPMODE and convert(Varchar(50),Added_On,103)=convert(Varchar(50),cdp.Added_On,103)
--)AS PRODUCT,(SELECT COUNT(*) FROM CCISold_Product_Details WHERE GROUPMODE=CDP.GROUPMODE and convert(Varchar(50),Added_On,103)=convert(Varchar(50),cdp.Added_On,103)
--)AS Qty  from CCISold_Product_Details AS CDP where Exhibition_Id like case when @Exid='All' then '%%' else '%'+@Exid end and Exhibition_Name like case when @ExName='All' then '%%' else '%'+@ExName end
--group by Exhibition_Id, Exhibition_Name,convert(Varchar(50),cdp.Added_On,103),CDP.GroupMode
end