locked
Create new categories in the following tutorial DB RRS feed

  • Question

  • User1044964059 posted

    hello everyone, I need yours help.
    for the hundredth time I was following the tutorial "Create a Movie Database Application in 15 Minutes with ASP.NET MVC (C #)"
    I state that I know little about programming, I would like to fix it because it is the only tutorial that I can not develop until the end.
    I freeze the section "created" HomeController  "are 37 days  stopped.. people say they are still studying to understand it alone to solve it .. ok, but I do not know what to study.
    I have an error "Exception of type 'System.NotImplementedException' in NomeSito.dll not handled in user code"
    I do not understand just what does not work and how to solve it.

    Going forward I'd like to be able to create a DB handle: Categories, Subcategories, and articles.
    I'm taking too long too ..


    Help me please I'm going bald from stress .. U.U


    Daniele

    Friday, May 2, 2014 7:26 AM

Answers

All replies

  • User-1353043493 posted

    provide sample code so i will help you..

    Friday, May 2, 2014 9:03 AM
  • User1918509225 posted

    Hi Danyblu,

    For you post,Here are my suggestions:

    1 Please try to post  code ,and  post the error details for us,so that we can solve it

    2 for you are not familiar with ASP.NET MVC,you can try to learn ASP.NETMVC step by step, following the link below:

    http://www.asp.net/mvc/tutorials/mvc-5/introduction/getting-started

    It will instruct you how to create control,model and view.and instruct you to connect to database using entity framework.

    In the link above ,it also provide a sample for you to learn.

    Hope it can help you.

    Best Regards,
    Kevin Shen.

    Monday, May 5, 2014 10:37 PM
  • User1044964059 posted

    Sorry, I was away for a few days due to force majeure, then this is the controller, I created the "List" and "Create" how to tutorials (identically) followed step by step.
    When I compile it performs perfectly the "List", just click on "Create" and insert the data in the new movie and hit enter I get written:
      Exception of type 'System.NotImplementedException' in MovieApp.dll not handled in user code.


    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Web;
    using System.Web.Mvc;
    using MovieApp.Models;

        namespace MovieApp.Controllers

        {

            public class HomeController : Controller

            {

                private MoviesDBEntities _db = new MoviesDBEntities();

                public ActionResult Index()

                {

                    return View(_db.Movie.ToList());

               

            }


            //
            // GET: /Home/Details/5
            public ActionResult Details(int id)
            {
                return View();
            }

            //
            // GET: /Home/Create

            public ActionResult Create()
            {

                return View();

            }

            //

            // POST: /Home/Create

            [AcceptVerbs(HttpVerbs.Post)]

            public ActionResult Create([Bind(Exclude = "Id")] Movie movieToCreate)
            {

                if (!ModelState.IsValid)

                    return View();

                _db.AddToMovie(movieToCreate);

                _db.SaveChanges();

                return RedirectToAction("Index");

            }
            //
            // GET: /Home/Edit/5
            public ActionResult Edit(int id)
            {
                return View();
            }

            //
            // POST: /Home/Edit/5
            [HttpPost]
            public ActionResult Edit(int id, FormCollection collection)
            {
                try
                {
                    // TODO: Add update logic here

                    return RedirectToAction("Index");
                }
                catch
                {
                    return View();
                }
            }

            //
            // GET: /Home/Delete/5
            public ActionResult Delete(int id)
            {
                return View();
            }

            //
            // POST: /Home/Delete/5
            [HttpPost]
            public ActionResult Delete(int id, FormCollection collection)
            {
                try
                {
                    // TODO: Add delete logic here

                    return RedirectToAction("Index");
                }
                catch
                {
                    return View();
                }
            }
        }
    }

    Do you know what is in my opinion the greatest lack in the web? Code completed and working, that you can download to study them.

    I can not figure out how to studied MVC, C #, QSL DB.
    Many tutorials but do not understand the method unfortunately, maybe even I have serious learning problems XD
    but for me it is a matter of vital importance to learn in the shortest period of time =|

    Tuesday, May 6, 2014 10:21 AM
  • User1918509225 posted

    Hi Danyblu,

    For your post,I think the problem is below:

    _db.AddToMovie(movieToCreate);

    For I am not sure if you have AddToMoview method in your dbcontext ,I think It should be like

    _db.Movies.Add(movieToCreate)
    

    And I suggest that you should take a tutorials  to learn step by step,

    About How to use ASP.NET MVC, please refer to link below:

    http://www.asp.net/mvc/tutorials/mvc-5/introduction/getting-started

    About how to use Entity Framework ,please refer to link below:

    http://msdn.microsoft.com/en-us/data/ee712907.aspx

     

    Hope it can help you.

    Best Regards,

    Kevin Shen.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Tuesday, May 6, 2014 10:23 PM