Wednesday, September 3, 2014

Convert html table into kendo UI grid

You can easily change style of normal HTML table in Kendo Ui Grid.

Just using the script :

  <script>  
         $(document).ready(function() {  
           $("#grid").kendoGrid({  
             height: 550,  
             sortable: true  
           });  
         });  
       </script>  

Now the script in your table

  <table id="grid">  
  </table>  

Monday, September 1, 2014

SQL Get Month First Date & Last Date From given month id & year id



To get the value of month first date & last date int value you can try this:

  DECLARE @startOfMonth DATETIME     , @MonthID int, @YearId int  
                DECLARE @endOfMonth DATETIME  
                DECLARE @FromDate DateTime,@ToDate DateTime  
          SET @MonthID=2 set @YearId=2014  
                Select @startOfMonth = CAST(@YearID AS varchar) + '/' + CAST(@MonthID AS varchar) +'/'+ '01'       
                Select @endOfMonth = CAST(@YearID AS varchar) + '/' + CAST(@MonthID AS varchar) + '/'+ CAST(DAY(DATEADD(DD,-1,DATEADD(MM,DATEDIFF(MM,-1,@startOfMonth),0))) AS varchar)  
                Set @FromDate=@startOfMonth  
                Set @ToDate=@endOfMonth  
                SELECT @FromDate 'MonthStartDate',@ToDate 'MonthEndDate'  

SQL Get all Index create script from Database

To get all script from database as a create new index into another database you can use the following --Get all Index Script SELECT...