Saturday, 21 January 2017

Simple CRUD Operations In ASP.NET MVC 5

Tags
Here I am Solve Simple CRUD Operations In ASP.NET MVC 5

The Below Controller and Views for Retrieve the database Data 

The model is same for all CRUD operation.

Thursday, 19 January 2017

Some Important SQL Query

Tags



No.1. select Only Date from DateTime Database:-
//DOB- column Name Name
// [dbo].[Emp_tb]- Table Name
SELECT CONVERT(CHAR(10), DOB, 120) FROM [dbo].[Emp_tb];



No2. Joint 2 column name in one column in different name 

SELECT CONCAT(column_1,' ' ,column_2) AS Name FROM table_name 
// Make sure there is space between ''


Edit DataBase Using MVC

Tags
Here I am going to Show how to Edit  DataBase Data with the use of MVC
I have write 2 Types of Controller here.

//inside the bracket () am writing the Model, Controller, View Names


Model Class(Emp_tb):-

 public partial class Emp_tb
    {
   
        public int Id { get; set; }
        public string Name { get; set; }
        public Nullable<int> Age { get; set; }
        public Nullable<System.DateTime> DOB { get; set; }
        public string Sex { get; set; }
        public string Address { get; set; }
        public Nullable<bool> Active { get; set; }

   
    }


Retrive Data From DataBase Using MVC

Tags
Here I am going to Show how to Retrieve Data from DataBase with the use of MVC

//inside the bracket () am writing the Model, Controller, View Names

Model Class(Emp_tb):-

 public partial class Emp_tb
    {
     
        public int Id { get; set; }
        public string Name { get; set; }
        public Nullable<int> Age { get; set; }
        public Nullable<System.DateTime> DOB { get; set; }
        public string Sex { get; set; }
        public string Address { get; set; }
        public Nullable<bool> Active { get; set; }

     
    }