Tuesday, 3 September 2013

SQL SELECT DISTINCT Statement

DISTINCT keyword can be used to return only distinct (Unique) values.

SQL SELECT DISTINCT Syntax


SELECT DISTINCT column_name,column_name

FROM table_name;


SQL SELECT Statement

SELECT statement is used to select particular data from database.

SQL SELECT Syntax


SELECT column_name,column_name
FROM table_name;
OR


SELECT * FROM table_name;

Entity Framework approaches

There are 3 approaches we can use in Entity Framework

 1.Database First

2. Model First

3. Code First

Monday, 29 July 2013

Create table in sql server

Syntax:

CREATE TABLE table_name
(
column_name1 data_type(size),
column_name2 data_type(size),
column_name3 data_type(size),
....
);

Example:

CREATE TABLE Persons
(
PersonID int,
LastName varchar(255),
FirstName varchar(255),
Address varchar(255),
City varchar(255)

);

Create Database in Sql Server

CREATE DATABASE dbname;

or


CREATE DATABASE my_database;


Friday, 26 July 2013

Caching in Asp.net C#

.NET provides three primary forms of caching:

       page level output caching                                                        easy to implement
        user control level output caching (or fragment caching)         easy to implement 
       Using  Cache Object                                            More flexible throughout every layer of an application

1.   Page Level Output Caching
The simplest form of caching, output caching simply keeps a copy of the HTML that was sent in response to 
a request in memory. Subsequent requests are then sent the cached output until the cache expires, resulting in

 potentially very large performance gains (depending on how much effort was required to create the original page output—sending cached output is always very fast and fairly constant).
You have to give the duration in seconds for the page to be cached.

Implementation:
          <%@ OutputCache Duration="60" VaryByParam="*" %>
This directive, as with other page directives should appear at the top of the ASPX page, before any output.


2.   Fragment Caching, User Control Output Caching
Often, caching an entire page is not feasible, because certain parts of the page are customized for the user.

Monday, 25 February 2013

File is not dragging dropping to visual studio solution explorer

Solution:  file is not dragging dropping to visual studio when you run it as admininstrator , so open visual studio as non administrator then drag/drop it ...