Skip to main content

Posts

Showing posts from September, 2014

PIVOT in SQL Server

PIVOT() is used to convert  the rows to columns in SQL Server.  The example as give below.   SELECT ISNULL( PVT . JANUARY , '0' ) AS JANUARY,ISNULL( PVT . FEBRUARY , '0' )FEBRUARY,ISNULL( PVT . MARCH , '0' )MARCH, ISNULL( PVT . APRIL , '0' )APRIL,ISNULL( PVT . MAY , '0' )MAY,ISNULL( PVT . JUNE , '0' )JUNE,ISNULL( PVT . JULY , '0' )JULY, ISNULL( PVT . AUGUST , '0' )AUGUST,ISNULL( PVT . SEPTEMBER , '0' )SEPTEMBER,ISNULL( PVT . OCTOBER , '0' ) OCTOBER, ISNULL( PVT . NOVEMBER , '0' )NOVEMBER,ISNULL( PVT . DECEMBER , '0' ) DECEMBER FROM ( SELECT DATENAME(MONTH,CREATEDDATE) AS [MONTH], COUNT ( * ) AS CCOUNT FROM COMPANY WHERE TENANTID = 1 AND ISNULL(ISDELETED, 0 ) <> 1 GROUP BY DATENAME(MONTH,CREATEDDATE) ) AS TMP PIVOT( SUM (CCOUNT) FOR [MONTH] IN (JANUARY,FEBRUARY,MARCH,APRIL,MAY,JUNE,JULY,AUGUST,SEPTEMBER,OCTOBER,NOVEMBER,DECEMBER)) AS PVT

kendo ui validate and upload images files

Hi everyone, I am going to share the code sample to  validate and upload the image files using kendo ui with jQuery. The code details as give below. Table of Content 1. The cshtml razor view code. 2. jQuery and JavaScript code 3. MVC 5 controller code The razor view < div class ="form-group">    < label for ="bio" class ="control-label col-sm-2"> Kendo ui  Upload image file </ label >    < div class ="col-sm-10">            < input name ="files" id ="files" type ="file" />                                                     </ div > </ div > jQuery and JavaScript < script type ="text/javascript"> $( function () {     //This used for check and validate image file.     var onSelect = function (evn) {         if (evn !== undefined && evn !== null ) {             $.each(evn.files, function (ke

angularjs charts example mvc 5

< !DOCTYPE html > < html ng-app ="chartApp"> < head >     < meta charset ="utf-8" />     < title > angularjs charts </ title >     < style >         .chartCSS {             width : 500px ;             height : 300px ;         }     </ style >     < script data-require ="angular.js@1.2.2" src ="http://code.angularjs.org/1.2.2/angular.js" data-semver ="1.2.2"></ script >     < script data-require ="d3@*" data-semver ="3.3.11" src ="//cdnjs.cloudflare.com/ajax/libs/d3/3.3.11/d3.js"></ script >     < script type ="text/javascript" src ="https://rawgit.com/chinmaymk/angular-charts/bower/dist/angular-charts.min.js"></ script >     < script >         angular.module( 'chartApp' , [ 'angularCharts' ]);         function mainController($scope) {

configuring routes in angularjs

Hello everyone, I am going to share the code-sample for angularjs routing , the angularjs  routing  are used to linking URLs to controllers and views. We can achieve routing using below steps Declaring a Dependency in ngRoute  Route module Configuring the $ routeProvider The ng-view directive  $ routeParams  used to pass the route parameters. The reference files of Angular Route as given below < script   src ="//ajax.googleapis.com/ajax/libs/angularjs/1.3.0-rc.1/angular.min.js"></ script > < script   src ="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.0/angular-route.js"></ script > The AngularJs code-sample as given below var   app = angular.module( 'ConfigurRoutes' , [ 'ngRoute' ]);         app. config ( function   ($routeProvider) {             $routeProvider               .when( '/Home' , {                   templateUrl:   'Views/Home/index.cshtml' ,