Home
Archives for 2017
Saturday, 21 January 2017
Thursday, 19 January 2017
Some Important SQL Query
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
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; }
}
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
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; }
}
//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; }
}
Subscribe to:
Posts (Atom)