Dotnetjalps-asp.net

Exploring technologies through innovations!!

  • CodeMaid extension for visual studio

    Till now I’m a resharper fan boy and I still love using it. It is a great productivity tool. But it is not free for commercial use. So lots of my friends tell we want something open source or free which provide some kind of productivity over normal visual studio things and recently I came across CodeMaid extension of visual studio. It is a great plugin.

    What is CodeMaid?

    CodeMaid is an open source Visual Studio extension to cleanup, dig through and simplify our C#, C++, F#, VB, XAML, XML, ASP, HTML, CSS, LESS, JavaScript and TypeScript coding.

    You can download that from following link.

    http://visualstudiogallery.msdn.microsoft.com/76293c4d-8c16-4f4a-aee6-21f83a571496.

    It also got  a separate site for that from where you can see and learn all the features. Following is a link for that.

    http://www.codemaid.net/ – Here you can find latest news, feature list and documentation for code maid.

    You can find more at my personal blog @ www.dotnetjalps.com

    Shout it

  • Why continuous integration is your friend?

    In this post we are going learn benefits of Continuous Integration in Software Developments. Let’s understand what is continuous integration first and then we will discuss about benefits we are having.

    What is Continuous Integration in software development?

    As per wikipedia “Continuous integration (CI) is the practice, in software engineering, of merging all developer working copies with a shared mainline several times a day. It was first named and proposed as part of extreme programming (XP). Its main aim is to prevent integration problems, referred to as "integration hell" in early descriptions of XP”

    In simple words, Continuous Integration means whenever any developer from the project team commit/checkin code at that time build will be created with the help of build servers and it will be automatically deployed to a specific location with the help of build server.

    There are lots of open source and paid options are available for Continuous Integration like Team Foundation Server, Jenkins, TeamCity etc.

    You can found a complete comparision of this tools from the following link.

    http://en.wikipedia.org/wiki/ComparisonofContinuousIntegrationSoftware

    More @ my person blog http://www.dotnetjalps.com

    Shout it

  • Various way of finding duplicate rows in SQL Server

    Recently One of the friend ask how we can find duplicate rows in SQL server so I said there are various way of finding duplicates and then I show him few ways of findings duplicate based on criteria. I thought it is a very basic question and still lots of people does not know how to find duplicate rows in SQL Server. So it is good idea to write blog post about it. In this blog post I’m going to explain the same various way of finding duplicates.

    First all, We need a table to find duplicate rows. So following is a table for that.I have created Employee table with four fields.

    CREATE TABLE [dbo].[Employee](
        [Id] [int] NOT NULL,
        [FirstName] nvarchar NULL,
        [LastName] nvarchar NULL,
        [Designation] nvarchar NULL
    ) ON [PRIMARY]

    Now once you create this “Employee” table now it’s time to write insert data. I have inserted following data.

    Find-Duplicate-Row-SQL-Server

    More on my personal blog @ http://www.dotnetjalps.com

    Shout it

  • Creating DJango application with Python in Visual Studio

    In previous post I have written about creating a basic python application with visual studio. In this post we are going to learn how we can create a DJango application with Python in Visual Studio with the help of python tools for Visual Studio.

    What is DJango?

    As per wikipedia, DJango is a free open source web application framework written in python which follow ups model view controller architectural pattern.It is maintained by  DJango Software Foundation an independent non profit organization. Django’s primary goal is to ease the creation of complex, database driven websites. DJango emphasizes reusability and plugability   of component and principle of Don’t repeat your self.

    Creating DJango application with Visual Studio :

    Let’s create first DJango application with Visual Studio and Python tools for Visual Studio. So to create DJango application with we have to create a new project via File->New Project –> DJango project just like following.

    first-django-application-with-python-visual-studio

    More in my personal blog www.dotnetjalps.com

    Shout it

  • Creating first python application in Visual Studio

    Before some time I have blogged about Python tools in Visual Studio and explained how we install python tools with visual studio and start developing python application with the one of greatest editor in class Visual Studio. In this post we are going to learn how we can create a python application in Visual Studio.

    First check whether Python Interpreters are install on your machine or not?

    First step for creating python application with Visual Studio is to check whether Python interpreters are installed or not not. To Check this after installing Python tools for Visual Studio go to Tools menu –> Python Environments and it will show a list of python environments available.

    Python Enviroments for Visual Studio

    If it is not installed, you need to download from http://www.python.org/. I have already installed Python 3.3 so its showing there.

    Read more on my personal blog

    Shout it

  • Python tools for Visual Studio

    Lots of people complaining that Microsoft does not support open source that is a myth about Microsoft it does support there are lots of open source initiative done by Microsoft and Python tools for Visual Studio is one of them.

    With the help of this plugin you are able to do work on python on Visual Studio one of best editor in class.

    Here is the link from you can download the Python tools for Visual Studio. Python tools are available for Visual Studio 2010,2012 and 2013. You can download the tools according your version.

    PythonToolsForVisualStudioCodePlex

    Go to download and here you can download Python as per your visual studio version 2010,2012 or 2013.

    Pythontoolsfordiffrentvisualstudioversion

    Here you have various like From Existing Application, Python Application, DJango Project, Python MPI application. You can also see there is IronPython support is also there.

    Read more on my personal blog

    Shout it

  • throw new exception- C#

    This post will be in response to my older post throw vs. throw(ex) best practice and difference- c# comment that I should include throw new exception.

    What’s wrong with throw new exception:

    Throw new exception is even worse, It will create a new exception and will erase all the earlier exception data. So it will erase stack trace also.Please go through following code. It’s same earlier post the only difference is throw new exception.

     

    using System;

    namespace Oops { class Program { static void Main(string[] args) { try { DevideByZero(10); } catch (Exception exception) { throw new Exception (string.Format( "Brand new Exception-Old Message:{0}", exception.Message)); } }

        public  static void DevideByZero(int i)
        {
           int j = 0;
           int k = i/j;
           Console.WriteLine(k);
    
        }
    }
    

    }

    Now once you run this example. You will get following output as expected.

    Throw new exception C#

    Hope you like it. Stay tuned for more..

    Shout it

  • Getting Started with NHibernate and ASP.NET MVC- CRUD Operations

    In this post we are going to learn how we can use NHibernate in ASP.NET MVC application.

    What is NHibernate:

    Nhibernate

    ORMs(Object Relational Mapper) are quite popular this days. ORM is a mechanism to map database entities to Class entity objects without writing a code for fetching data and write some SQL queries. It automatically generates SQL Query for us and fetch data behalf on us.

    NHibernate is also a kind of Object Relational Mapper which is a port of popular Java ORM Hibernate. It provides a framework for mapping an domain model classes to a traditional relational databases. Its give us freedom of writing repetitive ADO.NET code as this will be act as our database layer. Let’s get started with NHibernate.

    How to download:

    There are two ways you can download this ORM. From nuget package and from the source forge site.

    1. Nuget - http://www.nuget.org/packages/NHibernate/
    2. Source Forge-http://sourceforge.net/projects/nhibernate/

    More on my personal blog

    Shout it

  • Move line up down with Visual Studio 2013 Preview

    Visual Studio is a Great IDE and with the new launch of Visual Studio 2013 we are getting more and more new features. I have just discovered a new feature for Visual Studio 2013 and I thought it will be a good idea to write a blog post about it.

    During writing code some times we required to move lines of code up and down the earlier we have to cut and paste the line. But with Visual Studio 2013 preview there a short cut to do that and it will be useful when we are refactoring our code and doing some changes. There is a short cut to move lines up with Alt + up arrow keys and same way for moving down Alt+ down keys.

    For example I have following code there.

    UpArrowKeyMoveLinesvisualStudio2013

    Now I am pressing Alt+ Up arrow keys

    UpArrowKeyMoveLinesvisualStudio20132

    So you can see its now moved up. That’s it hope you like it. Stay tuned for more..

    Shout it

  • Deferred vs Immediate execution in Linq

    In this post, We are going to learn about Deferred vs Immediate execution in Linq.  There an interesting variations how Linq operators executes and in this post we are going to learn both Deferred execution and immediate execution.

    What is Deferred Execution?

    In the Deferred execution query will be executed and evaluated at the time of query variables usage. Let’s take an example to understand Deferred Execution better.

    Example:

    Following is a code for that.

    using System;
    using System.Collections.Generic;
    using System.Linq;

    namespace ConsoleApplication1 { class Program { static void Main(string[] args) { var customers = new List<Customer>( new[] { new Customer{FirstName = "Jalpesh",LastName = "Vadgama"}, new Customer{FirstName = "Vishal",LastName = "Vadgama"}, new Customer{FirstName = "Tushar",LastName = "Maru"} } );

            var newCustomers = customers.Where(c =&gt; c.LastName == &quot;Vadgama&quot;);
    
            customers.Add(new Customer {FirstName = &quot;Teerth&quot;, LastName = &quot;Vadgama&quot;});
    
            foreach (var c in newCustomers)
            {
                Console.WriteLine(c.FirstName);
            }
        }
    
        public class Customer
        {
            public string FirstName { get; set; }
            public string LastName { get; set; }
        }
    
    }
    

    }

    More on my personal blog @www.dotnetjalps.com

    Shout it