Thursday, 8 May 2014
Monday, 28 April 2014
how to get nth highest and lowest salary in sql server
Ex Code: Lowest case :
select top 1 column as 'salary' from (select distinct top 4 column from Table order by ID asc) a order by ID desc
Highest Case:
select top 1 column as 'salary' from (select distinct top 4 column from Table order by ID desc) a order by ID asc
select top 1 column as 'salary' from (select distinct top 4 column from Table order by ID asc) a order by ID desc
Highest Case:
select top 1 column as 'salary' from (select distinct top 4 column from Table order by ID desc) a order by ID asc
Tuesday, 1 April 2014
linq get second highest number or salary
Use this query:
var employees = Employees
.GroupBy(e => e.Salary)
.OrderByDescending(f => f.Key)
.Skip(1).Take(1)
.First();
var employees = Employees
.GroupBy(e => e.Salary)
.OrderByDescending(f => f.Key)
.Skip(1).Take(1)
.First();
Friday, 28 March 2014
how to count number of online users in asp.net
Simple two steps:
1.Add this code in Global.asax
1.Add this code in Global.asax
void Application_Start(Object Sender, EventArgs E)
{
Application["CurrentUsers"] = 0;
}
void Session_OnStart(object Sender, EventArgs E)
{
Application.Lock();
Application["CurrentUsers"] = System.Convert.ToInt32(Application["CurrentUsers"]) + 1;
Application.UnLock();
}
void Session_OnEnd(object Sender, EventArgs E)
{
Application.Lock();
Application["CurrentUsers"] = System.Convert.ToInt32(Application["CurrentUsers"]) - 1;
Application.UnLock();
}
2.In Aspx Page
<%=Application["CurrentUsers"].ToString()%>
In web.config timeout will be make 10, by default 20
Friday, 21 March 2014
hex code for checkbox and apply to css
HEX Code for check box is :
Checked :2610,
Un Checked :2611.
In Css
.checked:before
{
content:"\2611";
}
Checked :2610,
Un Checked :2611.
In Css
.checked:before
{
content:"\2611";
}
in Aspx page or html page or View
<a href="#" class="checked"></a>
Tuesday, 11 March 2014
dynamic menu li selected item highlighted using jquery or javascript
Use the following steps for archiving li selected item highlited.
Loop Code :1
@foreach (class obj in list)
{
<ul>
<li class="@obj.strName" style="font-weight:bold;" ><a href="#" style="text-decoration:none;" >
</a></li>
</ul>
}
Css: 2
.li
{
background-color:#bb0d2d !important;
color: white !important;
}
JQuery: 3
$('li').click(function () {
$(this).addClass('li');
});
Loop Code :1
@foreach (class obj in list)
{
<ul>
<li class="@obj.strName" style="font-weight:bold;" ><a href="#" style="text-decoration:none;" >
</a></li>
</ul>
}
Css: 2
.li
{
background-color:#bb0d2d !important;
color: white !important;
}
JQuery: 3
$('li').click(function () {
$(this).addClass('li');
});
Wednesday, 5 March 2014
default button in html using jquery
use this steps:
Html or aspx or View
create textbox and button in the page and assign id,
Then,
JQUERY
$("#textboxID").keyup(function (event) {
if (event.keyCode == 13) {
$("#buttonID").click();
}
});
Html or aspx or View
create textbox and button in the page and assign id,
Then,
JQUERY
$("#textboxID").keyup(function (event) {
if (event.keyCode == 13) {
$("#buttonID").click();
}
});
Subscribe to:
Posts (Atom)