Friday, 24 February 2012

Implementation of fragment caching in asp.net

Lets first create a user control.

ASCX PAGE

<%@ Control Language="C#" AutoEventWireup="true" CodeFile="CahceUserControl.ascx.cs"

Inherits="CahceUseControl" %>

<%@ OutputCache Duration="5" VaryByParam="None" %>



<p><asp:Label ID="lblTime" runat="server" EnableViewState="false"

ForeColor="GradientActiveCaption" /></p>

How can we use groupby statement in sqlserver

The GROUP BY clause can be used in a SELECT statement to collect data across multiple records and group the results by one or more columns.
The syntax for the GROUP BY clause is:
SELECT column1, column2, ... column_n, aggregate_function (expression)
FROM tables
WHERE predicates
GROUP BY column1, column2, ... column_n;
aggregate_function can be a function such as sum , count, Min and Max.

Wednesday, 22 February 2012

Find the nth highest salary in sql -Query to retrieve value

The following solution is for getting 6th highest salary from Employee table :-
 SELECT TOP 1 salaries
FROM (
SELECT DISTINCT TOP 6 salaries
FROM employee
ORDER BY salary DESC) a
ORDER BY salary


How can we insert image using file upload control using asp.net

1.Firstly create Table
2.Secondly create store procedure

Then .cs page code below:-

if (FileUpload1.HasFile)
            {
                string productname = txtProductName.Text;
                byte[] productimage = FileUpload1.FileBytes;

Wednesday, 1 February 2012

Learn about loops in c#

While Loop:- While loop is use when we have to check a condition and then continues to execute a block of code as long as the condition evaluates to boolean value of true.
Syntax:- while (<boolean expression>) { <statements> }.
using System;
                                class whileloops
                                 {
                                    public static void main()
                                       {
                                          int abc=0;
                                          while(abc<20)
                                            {
                                                console.write("{0}", abc)
                                               abc++;
                                              }

Implementation of Interface in C#

An interface is look like classes but in interface have no implementation. It contains the declaration of  events,methods, indexers and properties. Interfaces provide only declaration because they are inherited by classes and structs which must provide implementation for each interface member declared.

Defining an Interface:-
interface IUInterface
{
 void ImplementationToMethod();
}

Tuesday, 31 January 2012

Versions of Silverlight

Silverlight 1.0

This is the first release of Silverlight technology in 2007.Originally this release was called WPF/E, which stands for Windows Presentation Foundation/ Everywhere. This release consists of the core presentation framework, which is responsible for UI, interactivity and user input, basic UI controls, graphics and animation, media playback and DOM integration.
The Major drawback of this release is not supporting managed code, which means you can't use .NET supported programming languages for manipulating GUI elements. This was managed by scripting programming languages like Java Script (Only interpretation no compilation), which is hard for non Java Script programmers.