Chander Dhall's Blog

  • Why I love Discountasp.Net?

    Always ahead of the game

    Long back when I started looking for .NET 4.0 hosting, I was very surprised to see that Discountasp.net had support for it. This is way before any other hosting I knew at that time supported .NET 4.0. The same happened when I wanted hosting support for Node.js on the Windows Platform. Guess what, Discountasp.net had it. I even remember asking them a question about deployment where they helped me to an extent of fixing my web.config (which was obviously my problem not theirs). Not only the support was quick, they owned the problem, fixed it and didn't even complain that it's my problem. For $10-20 a month this was unbelievable for me and I turned a fan overnight. Don't be surprised when I tell yo that they are supporting WebSockets too.

  • Microsoft Sql Server driver for Nodejs - Part 2

    This post is part 2 of Microsoft Sql Server driver for Node js.In this post we will look at the JSON responses from the Microsoft Sql Server driver for Node js.

    Pre-requisites:

    • If you have read the Part 1 of the series, you should be good.
    • We will be using a framework for Rest within Nodejs - Restify, but that would need no prior learning.

    Restify:

    Restify is a simple node module for building RESTful services. It is slimmer than Express. Express is a complete module that has all what you need to create a full-blown browser app. However, Restify does not have additional overhead of templating, rendering etc that would be needed if your app has views. So, as the name suggests it's an awesome framework for building RESTful services and is very light-weight.

  • Microsoft Sql Server driver for Nodejs

    NOTE: Part 2 is available here

    Node is one of the recent geek fever everyone has been going through. With the continued support from Microsoft for Nodejs on both Windows and Windows Azure, it is bound to reach great levels. Last week, during TechEd, Microsoft released it's own version of a Sql server driver for Nodejs. Yes, now you can write javascript code on the server that will talk to Sql Server.

    Question: I haven't done any programming on Nodejs before this?

    Answer: Don't worry about it. As long as you know typing on a notepad. You should be good.

    NOTE: Documentation on this is still under construction but this blog post should get you started easily. If you have any questions during installation please feel free to contact me and I would be more than willing to help out.

    First database call:

    • Only on windows? Before we talk about it in detail it might be worthwhile to note that it only works if the nodejs server is running on a windows machine. Yes, that's true.
    • Does that mean you can't code on a mac? No, you can. In that case you can run the server on a windows box or one of the Windows Azure VMs. Cool!

      Alrite. Let's take a small Hello world example. I have database called Test with a table Employee and two columns EmployeeID and Name.

  • Visual Studio 11 - Getting Started Part 2

    In the previous post, we got a quick start into Visual Studio 11 and checked out the web templates associated with Asp.Net MVC4 and some cool new features. In this post we will look into one of the most useful and intriguing features of Visual Studio 11 - Page Inspector.

    To be honest, Page Inspector beats anything on the lines of dom-visualization as well as server-side code visualization in the development world. According to MSDN - "Page Inspector is a tool that renders a web page (HTML, Web Forms, ASP.NET MVC, or Web Pages) directly within the Visual Studio IDE and lets you examine both the source code and the resulting output. For ASP.NET pages, Page Inspector lets you determine which server-side code has produced the HTML markup that is rendered to the browser. Page Inspector works even when the default ASP.NET bundling and minification features are enabled."

    NOTE: I am using the Single Page Application (SPA) template to demonstrate the funcitonality of Page Inspector. If you are planning on following the code below, please go to Visual Studio 11 and create a new project with SPA template.

    How to use Page Inspector:

    • Open Page Inspector: Right - click on your web application and select View in Page Inspector (screenshot below). Page inspector works on the current version of IE installed on your machine. In my case, I am still using IE 9 and this works for me.

     

  • Visual Studio 11 - Getting Started

    Visual Studio 11 comes with a set of cool features for web developers. This series is focused on but not limited to additions in VS tools for web developers. When you open VS 11 you just can't ignore the new Monochrome-feel. As web developers the first thing you'll notice would be the additions of new templates.

    Let's just go to File -> New Project and then click Visual C# (inside Templates) -> Asp.Net MVC4 application. You will find 5 templates (apart from the Empty template) which are described below:

    • Internet Application: Gives you an Mvc4 project with an account controller that uses forms authentication.
    • Intranet Application: Gives you an Mvc4 project which uses windows authentication.
    • Mobile Application: Newest addition. Yes, you can create cross-browser mobile applications in Mvc4 (details later). This also comes with an account controller that uses forms authentication
    • Web API: Again a new feature that let's you create Restful (Http-based) API. Hint: Won't have to use Wcf Restful API anymore if you are only planning on using this code for web applications. Wcf, though, will still make sense in applications where you can have a combination of different thick and thin clients making requests through a services-layer.
    • Single page application: Think of a scenario where you want to use HTML5, Javascript, CSS3 and Ajax to create a Single Page Web application giving the user the look and feel of a desktop application on the browser. This is a new template that helps you do that.(details later)

    You can create a Unit Test project if you want to, otherwise, you can go ahead and hit OK. Without getting into the details of the template type I selected, let's talk about the new features. These are some features that are evidently new and cannot be missed by the human eye.

  • Book Review - Asp.net MVC3 by Steven Sanderson (Apress)

    Pro ASP.Net MVC 3 Framework
    Review by Christian Brubaker

    This is the second book I have read on ASP.Net MVC, but the first on MVC 3. The MVC pattern has been around for decades and is gaining more momentum amongst developer communities like .Net and Ruby. Suffice it to say, I was anxious about reading this book not only for the material, but to see how well MVC Pattern was covered and made use of in examples.

    Firstly, the authors do a great job at keeping you interested as well as informing and teaching. The book starts out with a history of web development and points out key differences between MVC and other web implementations. There is also quite a bit of mention on TDD. By chapter 3 you are rolling up your sleeves for your first Hello World application. The book continues forward outlining language features for working with Microsoft’s implementation. Although most of the language features aren’t specific to MVC, I felt that it highlighted how using said features can simplify code and improve code reuse and maintenance.

    The next few points in the book are specific to frameworks/tools that the authors chose to demonstrate how easy integration is with MVC. They do mention that there are several ways to skin a cat and, quite frankly, would have needed another book just to cover all of them.

    Razor is the view engine that was picked for this book and there is quite a lot of material to cover since this is fairly new. I picked up a lot of tips and useful information in this area of the book. Having worked with several technologies like JSP, ASP, Asp.Net, etc in the past, I was blown away by how clean and syntactically beautiful the Razor view engine is.

    The tools section of the book covered only Ninject (IoC) and Moq frameworks. This was fine for me since they are the two I use most often when doing TDD. Again, great job covering these and showing how easy they blend into the MVC framework. I feel anyone unfamiliar with TDD would have a good understanding of its usefulness as well as how to easily implement it against and MVC project.

    The next few chapters keep your feet wet with building out a store website. Who doesn’t love a lot of code and examples in a tech book right? There is lots of code, testing, mocking, and just plain fun in this one.

    Throughout the rest of the book you are introduced to MVC concepts (Models, Views, Controllers, Actions, Routes, Filters, Partial Views, Layouts, etc) and are given in-depth descriptions and understandings of them. These topics are essential to the framework and require a lot of teaching to fully understand and appreciate them. Adam and Steven do a wonderful job at this. A lot of tech books seem dry when it comes to that part and I often loose interest, but not with this book.

    I learned a lot by reading this book and will be keeping a copy for referencing and will most definitely read it again. There was so much covered in this book, that I will need to go back through it now that I am working with MVC 3 and Razor.

  • Book reviews published

    Our .net user group at UTDallas came up with the following reviews from the summer book club

    1. Windows power shell in action, second edition: I am not sure if Manning was the first published to come up with a book on Windows power shell but all I know is that everytime I need a comprehensive book on a new topic like power shell Manning would have one coming up pretty soon. I am a fan of 'in action' books and Windows powershell in action covers the foundation as well as the advanced concepts like security. Being a .net developer power shell and dot net is my favorite chapter and I am amazed with what all I can do after reading this book. Must Read - Josh Perry

    2. Hadoop in Action: Been in Microsoft technology stack for more than 5 years, I had been looking for an open source alternative for Big data and Hadoop caught my attention. Hadoop in action was the only resource I used to learn Hadoop and I know enough to be dangerous :) I recommend the book for anyone who wants to get into distributed systems and get a great understanding of map reduce algorithms: Chris Coley

    3. Android in action, second edition: If you are looking for a book that is promising enough to take you not only the through the basics of Android but to the next level, this is it. Android in action, covers graphics, multimedia, bluetooth and sensors, localization and app widgets apart from the quintessential fundamentals of android programming. Android development has been fun and easy after reading the book. Abhay Gupta