Posts

Showing posts from June, 2016

AngularJs Tutorial-1

Angular Js Tutorial ----------------------------------------------- Angular Js prog 1 : To get input from text field and display the message 1)Create a html page and copy paste the content under HTML to the file 2)Under app.js add the router content 3)Under Index.html add the controller.js content 4)Create a javascript File mypage.js and add the content of the "Controller.js" to it 1) HTML ----------------------------------------------- <div>     <p>{{message}}</p>     <input type ="text" size="50" ng-model="myVariable"/>     <input type="button" ng-click="submit()" value="submit"  /> </div> 2) app.js ----------------------------------------------- 'use strict'; angular.module('mytodoApp', [     'ngAnimate',     'ngCookies',     'ngResource',     'ngRoute',     'ngSanitize',     'ngTouch'   ])   .config(function ($rou

Understanding Master Page

Master Page - maintains a consistent looking behaviours.ContentPageHolder - Region where Content pages can be plugged in. Master Pages are merged into content pages. MasterPageFile="~/Site1.Master"  -->Content pages have tis directive inside the design page ,which indicate that it is associated with MasterPageFile ContentPlaceHolderID-> established link between masterpage and content page holder Passing data from content page to master page in asp net 1)With the help of public property of master page and exposing the property to content pages we can enable data transmission from content page to masterpage 2)<%@ MasterType VirtualPath="~/Site1.master" %> this directive to the contenet page that will enebale us to get the property from master page to the contenet page without any type casting Page.Master property always returns an object of type MasterPage and we need to explicitly typecast it to the actuall master page, if we need to access its proper

Interview Question PART2

Default accessspecifier for a class -------------------------------------------------------------------------------------------------------- 1)Its internal by default and public can be made for non-nested types 2)Its private by default and any other can be used for nested type class What are strong names in Assebliems -------------------------------------------------------------------------------------------------------- A strong name consists of the assembly's identity — its simple text name, version number, and culture information (if provided) — plus a public key and a digital signature. Nullable types in .NET -------------------------------------------------------------------------------------------------------- In reality, most applications work with databases, which have their own type systems. The implications of working with database type systems is that you don’t have a one-to-one mapping between C# and database types. One glaring difference is that database types ca

Interview Questions PART1-IEnumerable,VAR,DYNAMIC,READONLY,CONST Keywords

IEnumerable and IQueryable 1) IEnumerable is suitable for performing iteration on in memory collection like list,array 2)While querying data from the database, IEnumerable executes "select query" on the server-side, loads data in-memory on the client-side and then filters the data. 3)If you create an IEnumerable, then all rows will be pulled into memory as objects before running the query. 1)IQueryable is suitable for querying data from out-memory (like remote database, service) collections. 2)While querying data from a database, IQueryable executes a "select query" on server-side with all filters. 3)If you create an IQueryable, then the query may be converted to sql and run on the database server  VAR and DYNAMIC KEY WORD in .NET //VAR has to be initialized at compiletime             //VAR cannot be reinitialized more that once             var str = "hello";             Console.WriteLine(str);             //dynamic is not required to be initialized at co

USING LINQ to SQL utility.(With and witout Lambda Expression)

To use Linq on the sql database, .net is required to have a map the database tables/stored procedures to Linq SQL classes.Right click on the solution to and click on add new item, Select LINQ TO SQL classes , We will get a .dbml file file nae: linq_Sql created.From the server explorere panel you can drag and drop a table in the .dbml file created. The .cs file of the .dbml file willl contain the filenameDatacontext class whcih is used to get the tables present there.     class Program     {         static void Main(string[] args)         {             linq_SqlDataContext mydb = new linq_SqlDataContext();             var employees = from name in mydb.Employee_Tables                             where name.Age > 25                             && name.Salary > 12000                             select name.Name;             Console.WriteLine("List of People from Database with Linq Query ");             foreach (string n in employees)             {                

Linq and Lamda Expression

Lamda Expression: (input Parameter) => Method Expression 1) The input parameters are not defined previously and is determined dynamically when the expression is evaluated LINQ : is ‘Language Integrated Query Basically, LinQ provides a whole new way to manipulate data, either to/from database, or with XML file or with simple list of dynamic data. Basic example of Linq Query using employee list. Getting the names of employees having age greater than 24 using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace Linq_Lambda_Practice {     class Employee     {         public string Name { get; set; }         public int Age { get; set; }         public static List<Employee> emp;         //Constructor is declared static since employee object needs to be created only once.         static Employee()         {              emp= new List<Employee>();                      }        // A normal constructor is declared