Tuesday, 14 November 2017

Convert Object to DataTable in C#

Converting object to datatable using the C# code, it help in many places like doing the bulk insertion of data to database. There we need to send data in the form of table.
Suppose we have an Employee Class.

public class Employee
        public int EmployeeId { get; set; }
        public string EName { get; set; }
        public int Age { get; set; }
        public decimal Salary { get; set; }

Now instead of creating method for converting the object to datable, we will create a generic extension method which will convert any type of object into datatable.
public static class Utility

Thursday, 2 November 2017

MVC 5 Not working in IIS 7

It’s a common problem when MVC application is not working in IIS but working good with IIS Express.

This is happening as you have installed IIS after Visual studio and due to this reason ASP.net is not registered with IIS.

You just need to register your ASP.net   like below.

Register ASP.NET

64 bit system
C:\Windows\Microsoft.NET\Framework64\v4.0.30319>aspnet_regiis –i

32 bit system
C:\Windows\Microsoft.NET\Framework\v4.0.30319>aspnet_regiis –i

Friday, 27 October 2017

Changing icon on Collapse and Expand Panel

Collapsing and Expanding  for Panel is make very easy by Bootstrap that you can directly achieve using bootstrap.js and Bootstap.css [You can download it from getbootstrap.com]. Than need to write a simple code to change the icon using jQuery. 
Please see below that how to demostrate Changing icon on Collapse and Expand Panel.

It will be look alike below.

Friday, 6 October 2017

Cordova Exit from App

Code to exit from  mobile app using the JQuery Code (Cordova exit app event).

Code for exit from app

  exitFromApp: function () {

        if (navigator.app) {
        else if (navigator.device) {

        return false;


Exit from app when click button in android phonegap?

Calling Method

<button name="btnExit" style="background-color:transparent;color: #f82284 !important;font-size:18px;border:0" onclick="app.exitFromApp()" id="btnExit">Exit</button>

Wednesday, 30 August 2017

mvc checkboxlist example

Using the ckeckboxlist to display the records. It is having the items in the form of list box and having the checkbox in list.

It will be appear as like below. Here  I have implemented the checkbox list which will dynamically binding based on dropdown. mvc checkboxlist example
Its like cascaded checkboxlist, mvc checkboxlist multiselectlist.                       

Sunday, 6 August 2017

@html.grid mvc 5

Step by step process to bind MVC.Grid in MVc application
Grid will be display like below

Thursday, 3 August 2017

Generate Property and Methods Tool

You can automatically generate the property and method and insert query which help you to build the backed code faster.

Create an window application like below ;

Sunday, 30 July 2017

logging using nLog

nlog is free logging platform which use in .net, mobile platform. Its very easy to use and integrated with Visual studio Nuget package manager.

1.       Creating console application to check how to use nLog.

2.       Now add the nlog from Nuget package.

Friday, 23 June 2017

Configuring Angular 2 with Visual Studio 2015

Configuring Angular 2 with Visual Studio 2015
1.       Install Node.js from below Path based on your system requirement.

Check which version of node has installed.

It should be 3.x.x.x

Tuesday, 20 June 2017

Program to print pattern in C#

1. Program to print Half Pyramid using *

static void Main(string[] args)
            /// Printing of star pyramid



You will like to read it