How to show/hide progress bar or loader or spinner while download excel file on button click in asp.net
How many type of function in javascript
- Named Function
- Anonymous Function
- Immediately Invoked function expression.
Syntax:
function function_Name(param1, param2){
function body
}
function_Name();
Syntax:
var fun = function(param) {
do something here (Body of the function)
}
fun(param);
Let's understand with an example.
<script type ="text/javascript">
var anonymousFun = function(param1, param2) {
alert(param1 + " Good morning " + param2);
}
anonymousFun("Hello", "anonymous function");
</script>
Add the above code to a web page an run the application then output would be :
Hello Good morning anonymous function
<script type ="text/javascript">
var msg = (function(){
var name= "Dal Chand";
return name;
})();
</script>
Outpou: Dal Chand
Explain the named function in javascript with example
We are going to learn here about named function in javascript. Let's understand first what is named function.
Named Function: A function which is define with a name at the time of definition is called named function
Syntax:
function function_Name(param1, param2){
function body
}
function_Name();
Example: function Hi(name){
alert("Hello "+name);
}
Hi("Dev");
Output: Hello Dev
How to install Sql server
We'll learn here how to install sql server in system. Please follow below step to install sql server 2008 in your system.
Let me know if anyone is facing any issue while installing sql server.
Arithmetic overflow error converting numeric to data type numeric
Arithmetic OverFlow: It occur when we try to insert a value in a column or assign a value to a variable which is more than the limit of data type.
Let' say we have a variable of numeric type with size
Declare @IsArithmeticOverFlow numeric(5,2)
SET @IsArithmeticOverFlow = 999.999
SELECT @IsArithmeticOverFlow
will get the airthmetic error error here while executing the above statement because we defined the size of variable (5,2) and IsArithmeticOverFlow vaiable have the capacity to hold the value upto only 999, not more than it. but the value 999.999 is rounding to nearest vale. so, after rounding, the nearest vale is 1000. and the variable don't have the capacity now to hold 1000. so in this situation, will get arithmetic overflow error
Declare @IsArithmeticOverFlow numeric(6,2)
SET @IsArithmeticOverFlow = 999.999
SELECT @IsArithmeticOverFlow
![]() |
What is Javascript
JavaScript: JavaScript is an object-oriented programming language It was introduced in 1995 for adding programs to the web pages in the Netscape Navigator browser. Since then, it has been adopted by all other graphical web browsers. it is lightweight,cross-platform ,interpreted and full-fledged programming language. it is used by lot's of websites for scripting the web pages.
Using JavaScript, developers can develop modern web applications to interact directly without reloading the page every time. it also improve the performance of the application because mostly validation part done only at client side.
Benefit of JavaScript: There are lot's of benefit of javascript
1-JavaScript is lightweight,cross-platform and interpreted programming language
2-Validation can be done on client side due to that it's avoid the unnecessary round trip between client side and server side.
3-it also provide the facility to update the partially page rendering without reloading the entire web page.
How to truncate data from table in sql server
How to delete duplicate data from physical table in sql server
We'll learn here How to delete duplicate data from physical database table.
Step1: let's create the table and insert the data into table.
CREATE TABLE [dbo].[Employee](
[Id] [int],
[Name] [nvarchar](50) NULL,
[Gender] [nvarchar](10) NULL,
[Salary] [int] NULL,
)
GO
Step2: Insert multiple record into employee table.
INSERT INTO Employee(Id,Name,Gender,Salary)
VALUES(1,'Amit','Male',5000),
(2,'Fernando','Male',20000),
(2,'Fernando','Male',20000),
(3,'Rahul','Male',10000),
(1,'Amit','Male',5000),
(4,'Atom','Male',7000),
(5,'SpTan','Female',5000)
Step3: check the data prior to delete operation with the help of below query.
Select * from Employee;
Output:
Step4: Let's delete data from table using CTE table.
WITH DeleteDuplicateRecord AS (
SELECT
ID, NAME, GENDER, SALARY, ROW_NUMBER()OVER
(PARTITION BY ID, NAME,GENDER,SALARY ORDER BY ID,NAME,GENDER,SALARY
) DuplicateRecord
FROM Employee)
DELETE FROM DeleteDuplicateRecord
WHERE DuplicateRecord > 1
Step5: check data after execute the delete operation.
Select * from Employee
How to find duplicate record in sql server
Step 4: So with the help of below query we can get the duplicate data from Employee table.






























