Posts

Showing posts from December, 2023

MVC CRUD Sample

Image
  First create a solution File -> New -> Project       then    select  as followed image Now created solution.Create a table 'TblRegister' on sql server database   Add Entity-framework package to solution using NuGet Packager  Right click Model folder  then go to   Add->New Item   select  ADO.NET Entity Data Model Create Entity Model of our  'CRUD' Database     (If need EF model creation tutorial. please visit https://www.tutorialspoint.com/entity_framework/entity_database_first_approach.htm )               Now db Entity model created like below pic      For Creating 'RegisterController' Right click Controller folder -> Add Controller  and add below code to on RegisterController  CRUDEntities dbEntity = new CRUDEntities();         // GET: Register         public ActionResult Index()         {             var res = dbEntity.TblRegisters.ToList();             return View(res);         }         public ActionResult Create()         {             return