Wednesday, December 21, 2016

Getting Started With Asp.Net Mvc

Creating your first Asp.Net Mvc application

  1. Visual Studio Open.
  2. Click File => New Project.
  3. Select Web and Select Asp.Net MVC 4 application.
  4. Write Name => MyFirstMVCApplication and Click OK.
    MyFirstMVCApplication
    MyFirstMVCApplication
  5. Select Empty template and View Engine as Razor and click OK.
    MyFirstMVCApplication
    Empty template
Visual Studio Created Asp.Net Mvc application.

Now, than after add Controller to your project.
  1. Right click Controllers Folder in our project  and Select => Add => Controller.
    ControllerImage
    Controller
  2. And Set Name HomeController and click Add.
    HomeControllerImages
    HomeControllerImage
Now, This will created class file HomeController.cs under controllersfolder.


using System;
using System.Web.Mvc;

namespace MyFirstMVCApplication.Controllers
{
    public class HomeController : Controller
    {
     public ViewResult Index()
        {

            return View();
         }   
     }
}

Now , We add new View  to our Home Controller to add new view , right click on View folder and click Add => View.
Views
View

First we write name is Index and  View engine select Razor(CSHTML) and  click OK.
Indexs
Index

New CSHTML file inside View/Home folder with the following code.

@{
    Layout = null;
    }

<html>
<head>
    <meta name="viewport" content="width=device-width" />
    <title>Index</title>
</head>
<body>
    <div>
    
    </div>
</body>
</html>

Now , Modify  above View  body content with the following code.

<body>
    <div>
     Welcome to My First MVC Application.
    </div>
</body>

Now , Run apllication 

Get OUTPUT
webpageviewimage
OutPut







Saturday, October 8, 2016

SQL Syntax

SQL is followed by unique set of rules and guidelines called Syntax.

SQL Statements


Most of the actions you need to perform on a database are done with SQL Statments.
SQL was designed to be entered on a console and results would display back to a screen.


SELECT * FROM TableName;

Example:

SELECT * FROM Employee;

Important SQL Commands


SELECT                           -     Read the data.
INSERT INTO                 -     Insert or Add new data.
UPDATE                          -     Update existing data.
DELETE                          -     Remove or Delete data.
CREATE DATABASE    -     Create new database.
DROP TABLE                -      Deletes a table.
CREATE INDEX            -     Create an index.
ALTER DATABASE      -      Modifies or Edit database.
CREATE TABLE           -      Create a  new table.
ALTER TABLE              -      Modifies or Edit table.
DROP INDEX                -      Remove or Delete index.

SQL Keyword are not case sensitive and some database systems required a semicolon at end of each SQL statement.


Database Tables


A database contains one or more tables.Each table is assigned with unique name.
Below is selection from the "Employee" table.

Employee Table
Employee Table

The table above contains four records and four cloumns (EmployeeId, EmployeeName, Address, Salary).

Friday, October 7, 2016

SQL Introduction

SQL (Structured Query Language) is a standard language for accessing and manipulating databases.


What is SQL?

SQL is  stands for Structured Query Language. SQL  lets your access and manipulate database.SQL is an ANSI (American National Standards Institute) standard. SQL is the standard language for Relation Database System. All relational database management systems like

  • MySQL.
  • MS Access.
  • Sybase.
  • Postgres.
  • SQL Server.
  • Oracle.
  • Informix.

 use SQL as standard database language.Also they are using different dialects such as

  • Oracle using PL/SQL.
  • MS SQL Server using T-SQL.
  • MS Access version of SQL is called JET SQL (native format) etc .




ASP.NET Introduction

What is ASP.NET?


Asp.Net is Web application framework developed and marketed by Microsoft to build dynamic data driven Web applications and Web services. It allow programming language such as 
  • C# .
  •  VB.Net
  • Java Script.
to build web applications easily.
Asp.Net framework is collection of classes and Asp.Net is the successor to classic ASP(Active Server Pages).

microsoft asp.net
Microsoft Asp.Net

Asp.Net is used produce interactive,data driven web application over the internet.It consists of a large number of controls such as text boxes,buttons,

and labels for assembling,configuring, and manipulating code to create HTML pages.

What is Web Application?


A web application is an application that is accessed by users using a web browser. For Example:

  1. Microsoft Internet Explorer.
  2. Mozilla FireFox.
  3. Google Chrome.
  4. Apply Safari.
  5. Netscape Navigator.

What are advantages of Web application?


1.Asp.Net reduces the amount of code required to build large applications.
2.Provides simplicity as ASP.NET makes it easy to perform common tasks, from simple form submission and client authentication to deployment and site configuration.
3It is purely server-side technology so, ASP.NET code executes on the server before it is sent to the browser.
4.With built in Windows authentication and per – application configuration,your application are safe  and  secured.
5.Being language independent, it allows you to choose the language that best applies to your application or partition your application across many languages.
6.The ASP.NET framework is complemented by a rich toolbox and designer in the Visual Studio integrated development environment. drag-and-drop server controls, and automatic deployment are just a few of the features this powerful tool provides.
7.The source code and HTML are together therefore ASP.NET pages are easy to maintain and write.Also the source code is executed on the server. This provides a lot of power and flexibility to the web pages.
8.It provides better performance by taking advantage of early binding, just-in-time compilation, native optimization, and caching services right out of the box.
9.All the processes are closely monitored and managed by the ASP.NET runtime, so that if process is dead, a new process can be created in its place, which helps keep your application constantly available to handle requests.
10.Asp.Net  makes for easy deployment. There is no need to register components because the configuration information is built-in.
11.The Web server continuously monitors the pages, components and applications running on it. If it notices any memory leaks, infinite loops, other illegal activities, it immediately destroys those activities and restarts itself.
12.Easily works with ADO.NET using data-binding and page formatting features. It is an application which runs faster and counters large volumes of users without having performance problems.

Tuesday, September 20, 2016

Asp.Net MVC Introduction

What is MVC ?


The Model View and Controller(MVC) architectural pattern separates an application into three main components.The Model,The View,and The Controller.The Asp.Net MVC framework Provides an alternative to the Asp.Net Web Forms Pattern for creating web applications.

What is MVC framework ?

MVC is one of three Asp.Net Programming models.MVC is a framework for building web application using a MVC (Model View Controller) desigin the Model represents the application core(for instance a list of database records).The view displays the data (the database records).

MVC Components

Model

The Model components corresponds to all the data related logic that the user works with.This can represent either  the data that is begin transferred between the View and Controller components or any other business logic related data.

View

The View components is used for all the UI logic of the application.

Controller

Controller act  as an  interface between Model and View  components to process all the business logic and incoming requests, manipulate data using the Model components and interact with the Views to render the final output.


mvc architecuture
MVC Architecuture


Asp.net Mvc framework is lightweight and Asp.net supports Web Page,Web Forms and MVC development models.The frmeworks is define in the System.Web.Mvc assembly.