$.ajax({type:"GET",url:"/api/employees/getemployee",data:{'id:'+Id},cache:false,success:function(data){$("#resultarea").text(data); }, error: function (){ } });
Category: Uncategorised
Difference between document.onclick() and click() function
There is no onclick event in jquery but there is .on eventinterviewer asks sometime
.click(handler): Bind an event handler to the “click” JavaScript event, or trigger that event on an element.
.on( events [, selector ] [, data ], handler ) : Attach an event handler function for one or more events to the selected element. they can process events from descendant elements that are added to the document at a later time.
So if you are adding an element on page dynamically and want to fire an event use .on .
Temp table in SQL Server(#temp,##temp,@table)
Temporary tables are useful when we want a manipulated data in tabular form at run time in query processing. A temporary table is visible to the session in which they were created and are automatically dropped when that session logs off.
Type of temp table
1) Local temp table: Syntax (create table #t).
If a temp table exist in a stored procedure it is automatically dropped when SP ends, i.e. temp table exist in current scope and current connection.
2) Global temp table: Syntax (create table ##t).
Global temp table can be accessed in any session in current connection and can be dropped in any session.
3) Temp variable: Syntax (create table @t)
A temp variable has all features of temp table but
It can’t be dropped manually,they are dropped automatically.
We can use a temp variable in user defined function but can’t do with temp table.
Extension Methods in C#
With help of extension method you can add a new method to an existing type without recompile and modifying existing type.
e.g.
string s = “hello”; string i = s.UpperCasefirstLater();
Result : Hello
Here UpperCasefirstLater is a extension method. see below code
public static class MyExtensions
{
public static string UpperCasefirstLater(this String str)
{
if (str.Length > 0)
{
char[] array = str.ToCharArray();
array[0] = char.ToUpper(array[0]);
return new string(array);
}
}
}
User-defined function or aggregate or the name is ambiguous in tabular Function in SQL server
Don’t USE
Select [dbo].[functionname](input)
USE
select * from [dbo].[functionname](input)