Itemupdating asp
10-Dec-2019 03:09
If you run the page now and select a genre you will get the following result for the Item Template. Notice also, we used a dropdownlist in order to select a Genre for a new Review. Mind though, that if you try to insert a new review at the moment you will get an error telling you that database couldn’t convert Date Time2 to Date Time or that Genre Id value wasn’t found.
That happens because if you have noticed, in the Insert Item Template we don’t provide values either for the or the Genre Id properties.
Rather than talking let’s create a Web Form where we will use a List View control to support CRUD operations for our items.
To give you a taste about how our List View will look like, take a look at the following picture which will be the costumized template for displaying Review objects.
If you want to follow along with this post, at the bottom of the page you can download the project we will create (as always), where you can find attached the SQL script you need to create the database and it’s tables. In Visual Studio 2012 create a new web site, choosing the Empty ASP. Name the site Entity Framework’s approach to create the classes automatically.We added a new Entity Data Source control with the same connection name “Movie Store Entities” in order to use our Entity Framework’s generated entities.