Get duplicate rows of a table


Get duplicate rows of a table
  
SELECT COUNT(*), colname FROM TABLE GROUP BY colname HAVING COUNT(*) > 1

this keyword

The this is a keyword, It refers to the current instance of the class.
It can be used to access members from within constructors,instance accessors instance methods and instance successor.


public class Demo4this
        {
            int age;
            string name;
 
            public Demo4this(int age, string name)
            {
               
                this.age = age;
                this.name = name;
             }
 
            public void Show()
            {
                Console.WriteLine("Your Name : " + name); 
                Console.WriteLine("Your Age :" + age.ToString());
             }
     }
static void Main(string[] args)
        {
            int age1;
            string name1;

            Console.WriteLine("Enter your name : ");
            name1=Console.ReadLine();
 
            Console.WriteLine("Enter your age : " );
            age1=Int32.Parse(Console.ReadLine());
 
            Demo4this obj = new Demo4this(age1, name1);
 
            obj.Show();
            Console.ReadLine();
            Console.ReadLine(); 
        }
    }
}
    

Size of stored procedure



 
Stored procedures are special objects available in sql server
It is a collection of transact sql statements that can take or return user supplied parameters.

It s a p recompiled statements where all the preliminary parsing operations are performed and the statements are ready for execution.

Maximum size of stored procedure is 128 MB.

Check isalphanumeric in sql server

ALTER FUNCTION dbo.ISALPHANUMERIC
(
 @columnfield VARCHAR(5000)
)
RETURNS VARCHAR(5000)
AS
    BEGIN
        DECLARE @splcharposition INT
        SET @splcharposition = PATINDEX('%[^0-9A-Za-z]%', @columnfield)
    WHILE @splcharposition > 0
        BEGIN
            SET @columnfield = STUFF(@columnfield, @splcharposition, 1, '')
            SET @splcharposition = PATINDEX('%[^0-9A-Za-z]%', @columnfield)
        END
        SET @columnfield = @columnfield
    RETURN @columnfield
    END
GO

Multiple onload event in dot net

Definition

Once a page has been loaded 'onload' event executes a JavaScript immediately.

We can use onload function in number of ways:

1. <body onload="load1()">
2. <element onload="SomeJavaScriptCode">
3. object.onload="SomeJavaScriptCode"
4. window.onload = load;

function load1() {
  alert("This is the first.");
}

onLoad Event handlers Examples

<frameset onload="framload()">
<img src="logo.gif" onload="imgload()">

 

USE of onload

 

This is used to invoke JavaScript function after the page or an image has finished loading.

 

How to get requesting page in C#

We can get requesting page url in C# to use below statement
Request.UrlReferrer.OriginalString

We can also check the particular page
if (Request.UrlReferrer.OriginalString.IndexOf("confirmation.aspx") > -1)
            {
// Code Here
                      }
We should include the namespace before that.
using System.Web;

Find iphone browser in c# code

I need to find the site has been opened in mobile browser version or not, if it opened in iphone browser, then i need to redirect other page. So i use UserAgent to find operating system details.

if (Request.UserAgent.ToLower().Contains("iphone") == true)
        {
            //Response.Redirect("mobile.aspx");
        }