<rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Adding a Create Method and Create View</title><link>http://asp.net</link><pubDate>Sat, 01 Dec 2012 23:01:34 GMT</pubDate><generator>umbraco</generator><description>Comments for Adding a Create Method and Create View</description><language>en</language><atom:link href="http://asp.net/rss/comments/33031" rel="self" type="application/rss+xml" /><item><title>Comment Posted by ritchiep</title><link>http://asp.net/mvc/tutorials/older-versions/getting-started-with-mvc/getting-started-with-mvc-part6</link><pubDate>Wed, 22 Sep 2010 13:10:38 GMT</pubDate><guid isPermaLink="false">00000000-0000-0000-0000000010334</guid><description><![CDATA[ <p>You created the Price column as decimal(10,0) so the &quot;9.99&quot; for When Harry Met Sally get&#39;s stored as 10--a little confusing.</p>]]></description><enclosure length="0" type="image/png" url="http://i3.asp.net/avatar/ritchiep.jpg?forceidenticon=false&amp;dt=635046037800000000&amp;enableAvatar=False&amp;cdn_id=2013-05-10-001" /></item><item><title>Comment Posted by crazy7th</title><link>http://asp.net/mvc/tutorials/older-versions/getting-started-with-mvc/getting-started-with-mvc-part6</link><pubDate>Thu, 23 Sep 2010 04:53:44 GMT</pubDate><guid isPermaLink="false">00000000-0000-0000-0000000010351</guid><description><![CDATA[ <p>i have lil bit problem... i found 2 error message like this :</p><p></p><p>1. The type or namespace name &#39;HttpPostAttribute&#39; could not be found (are you missing a using directive or an assembly reference?)</p><p></p><p>2. &#39;MyWebsite.Models.MoviesEntities&#39; does not contain a definition for &#39;AddToMovies&#39; and no extension method &#39;AddToMovies&#39; accepting a first argument of type &#39;MvcApplication4.Models.MoviesEntities&#39; could be found (are you missing a using directive or an assembly reference?)</p><p></p><p>regard&#39;s</p><p>Ekky Patria</p><p>ASP.Net Developer</p>]]></description><enclosure length="0" type="image/png" url="http://i3.asp.net/avatar/crazy7th.jpg?forceidenticon=false&amp;dt=635046037800000000&amp;enableAvatar=False&amp;cdn_id=2013-05-10-001" /></item><item><title>Comment Posted by chadsmith71</title><link>http://asp.net/mvc/tutorials/older-versions/getting-started-with-mvc/getting-started-with-mvc-part6</link><pubDate>Thu, 23 Sep 2010 13:44:55 GMT</pubDate><guid isPermaLink="false">00000000-0000-0000-0000000010355</guid><description><![CDATA[ <p>When I click &quot;Create&quot; button on the <a rel="nofollow" href="http://localhost:1930/Movies/Create" target="_blank">localhost</a> page, I&#39;m getting an &quot;UpdateException&quot; at db.SaveChanges(); line in the MovieController.cs file. I have followed the tutorial exactly, verified all files, spelling, etc. Any help would be appreciated.</p><p></p><p>Exception details:</p><p></p><p>Unable to update EntitySet &#39;Movie&#39; because it has a DefiningQuery and no &lt;InsertFunction&gt; element exists in the &lt;ModificationFunctionMapping&gt; element to support the current operation.</p>]]></description><enclosure length="0" type="image/png" url="http://i3.asp.net/avatar/chadsmith71.jpg?forceidenticon=false&amp;dt=635046037800000000&amp;enableAvatar=False&amp;cdn_id=2013-05-10-001" /></item><item><title>Comment Posted by smuggie</title><link>http://asp.net/mvc/tutorials/older-versions/getting-started-with-mvc/getting-started-with-mvc-part6</link><pubDate>Mon, 27 Sep 2010 02:46:53 GMT</pubDate><guid isPermaLink="false">00000000-0000-0000-0000000010401</guid><description><![CDATA[ <p>Regarding the &quot;Update exception&quot;, Add a primary key to the database, delete and re-create the .edmx file and the problem should go away.  You can find more info here.</p><p><a rel="nofollow" href="http://praveenbattula.blogspot.com/2009/10/unable-to-update-entityset-because-it.html" target="_blank">praveenbattula.blogspot.com/</a></p><p></p><p>When you do that,you might have to delete your old connection string in the web.config as well.  Otherwise you&#39;ll get movies.entities1.</p>]]></description><enclosure length="0" type="image/png" url="http://i1.asp.net/avatar/smuggie.jpg?forceidenticon=false&amp;dt=635046037800000000&amp;enableAvatar=False&amp;cdn_id=2013-05-10-001" /></item><item><title>Comment Posted by chadsmith71</title><link>http://asp.net/mvc/tutorials/older-versions/getting-started-with-mvc/getting-started-with-mvc-part6</link><pubDate>Mon, 27 Sep 2010 11:14:27 GMT</pubDate><guid isPermaLink="false">00000000-0000-0000-0000000010409</guid><description><![CDATA[ <p>smuggie, that got it. I looked back at the tutorial and missed the &quot;right click the Id field and make it a primary key&quot; instruction. doh! thanks for the resolution. I&#39;m coming from a Java/Oracle/Tomcat background and learning Asp.Net MVC for the very first time (if that&#39;s not already obvious).</p>]]></description><enclosure length="0" type="image/png" url="http://i3.asp.net/avatar/chadsmith71.jpg?forceidenticon=false&amp;dt=635046037800000000&amp;enableAvatar=False&amp;cdn_id=2013-05-10-001" /></item><item><title>Comment Posted by farzad</title><link>http://asp.net/mvc/tutorials/older-versions/getting-started-with-mvc/getting-started-with-mvc-part6</link><pubDate>Tue, 05 Oct 2010 04:15:55 GMT</pubDate><guid isPermaLink="false">00000000-0000-0000-0000000010499</guid><description><![CDATA[ <p>create function doesn&#39;t work for me , unless I remove the parameter. </p>]]></description><enclosure length="0" type="image/png" url="http://i3.asp.net/avatar/farzad.jpg?forceidenticon=false&amp;dt=635046037800000000&amp;enableAvatar=False&amp;cdn_id=2013-05-10-001" /></item><item><title>Comment Posted by rootsiroot</title><link>http://asp.net/mvc/tutorials/older-versions/getting-started-with-mvc/getting-started-with-mvc-part6</link><pubDate>Fri, 15 Oct 2010 04:21:08 GMT</pubDate><guid isPermaLink="false">00000000-0000-0000-0000000010629</guid><description><![CDATA[ <p>what is the HTML Helper for inserting file? hope to hear your answers asap...</p>]]></description><enclosure length="0" type="image/png" url="http://i1.asp.net/avatar/rootsiroot.jpg?forceidenticon=false&amp;dt=635046037800000000&amp;enableAvatar=False&amp;cdn_id=2013-05-10-001" /></item><item><title>Comment Posted by merin</title><link>http://asp.net/mvc/tutorials/older-versions/getting-started-with-mvc/getting-started-with-mvc-part6</link><pubDate>Fri, 22 Oct 2010 02:06:32 GMT</pubDate><guid isPermaLink="false">00000000-0000-0000-0000000010707</guid><description><![CDATA[ <p>Yes. I did it.</p>]]></description><enclosure length="0" type="image/png" url="http://i1.asp.net/avatar/merin.jpg?forceidenticon=false&amp;dt=635046037800000000&amp;enableAvatar=False&amp;cdn_id=2013-05-10-001" /></item><item><title>Comment Posted by ChristopherBales</title><link>http://asp.net/mvc/tutorials/older-versions/getting-started-with-mvc/getting-started-with-mvc-part6</link><pubDate>Tue, 02 Nov 2010 12:30:32 GMT</pubDate><guid isPermaLink="false">00000000-0000-0000-0000000010804</guid><description><![CDATA[ <p>If you&#39;re using MVC 1.0, you&#39;ll want to use</p><p></p><p>[AcceptVerbs(HttpVerbs.Post)]</p><p></p><p>in place of [HttpPost]</p>]]></description><enclosure length="0" type="image/png" url="http://i3.asp.net/avatar/ChristopherBales.jpg?forceidenticon=false&amp;dt=635046037800000000&amp;enableAvatar=False&amp;cdn_id=2013-05-10-001" /></item><item><title>Comment Posted by borateti</title><link>http://asp.net/mvc/tutorials/older-versions/getting-started-with-mvc/getting-started-with-mvc-part6</link><pubDate>Sat, 06 Nov 2010 00:58:12 GMT</pubDate><guid isPermaLink="false">00000000-0000-0000-0000000010844</guid><description><![CDATA[ <p>hi</p><p>i have a little problem...when i click create button it does not add the data into the database meaning it said my modelstate is invalid can u help</p>]]></description><enclosure length="0" type="image/png" url="http://i2.asp.net/avatar/borateti.jpg?forceidenticon=false&amp;dt=635046037800000000&amp;enableAvatar=False&amp;cdn_id=2013-05-10-001" /></item><item><title>Comment Posted by devenh</title><link>http://asp.net/mvc/tutorials/older-versions/getting-started-with-mvc/getting-started-with-mvc-part6</link><pubDate>Wed, 10 Nov 2010 16:11:47 GMT</pubDate><guid isPermaLink="false">00000000-0000-0000-0000000010910</guid><description><![CDATA[ <p>I&#39;m a little confused about how code below is working:</p><p>if (ModelState.IsValid)</p><p>{</p><p>  db.AddToMovies(newMovie);</p><p>   ...</p><p>}</p><p></p><p>How exactly is ModelState.IsValid working? where is db.AddToMovies() function defined?</p>]]></description><enclosure length="0" type="image/png" url="http://i3.asp.net/avatar/devenh.jpg?forceidenticon=false&amp;dt=635046037800000000&amp;enableAvatar=False&amp;cdn_id=2013-05-10-001" /></item><item><title>Comment Posted by mejamz</title><link>http://asp.net/mvc/tutorials/older-versions/getting-started-with-mvc/getting-started-with-mvc-part6</link><pubDate>Wed, 17 Nov 2010 21:25:55 GMT</pubDate><guid isPermaLink="false">00000000-0000-0000-0000000010981</guid><description><![CDATA[ <p>So far, so good :)</p>]]></description><enclosure length="0" type="image/png" url="http://i2.asp.net/avatar/mejamz.jpg?forceidenticon=false&amp;dt=635046037800000000&amp;enableAvatar=False&amp;cdn_id=2013-05-10-001" /></item><item><title>Comment Posted by Shyne98</title><link>http://asp.net/mvc/tutorials/older-versions/getting-started-with-mvc/getting-started-with-mvc-part6</link><pubDate>Sun, 21 Nov 2010 22:40:28 GMT</pubDate><guid isPermaLink="false">00000000-0000-0000-0000000011020</guid><description><![CDATA[ <p>public ActionResult Create(Movie newMovie) </p><p>I keep getting this error</p><p>-------------------------------------</p><p>Inconsistent accessibility: parameter type &#39;Movies.Controllers.Movie&#39; is less accessible than method &#39;Movies.Controllers.MoviesController.Create(Movies.Controllers.Movie)&#39;	</p><p>----------------------------------</p><p>somebody please help</p>]]></description><enclosure length="0" type="image/png" url="http://i2.asp.net/avatar/Shyne98.jpg?forceidenticon=false&amp;dt=635046037800000000&amp;enableAvatar=False&amp;cdn_id=2013-05-10-001" /></item><item><title>Comment Posted by gno</title><link>http://asp.net/mvc/tutorials/older-versions/getting-started-with-mvc/getting-started-with-mvc-part6</link><pubDate>Mon, 22 Nov 2010 16:10:15 GMT</pubDate><guid isPermaLink="false">00000000-0000-0000-0000000011026</guid><description><![CDATA[ <p>must use db.AddToMovie instead of db.AddToMovies</p>]]></description><enclosure length="0" type="image/png" url="http://i2.asp.net/avatar/gno.jpg?forceidenticon=false&amp;dt=635046037800000000&amp;enableAvatar=False&amp;cdn_id=2013-05-10-001" /></item><item><title>Comment Posted by urenjoy</title><link>http://asp.net/mvc/tutorials/older-versions/getting-started-with-mvc/getting-started-with-mvc-part6</link><pubDate>Sat, 27 Nov 2010 02:42:27 GMT</pubDate><guid isPermaLink="false">00000000-0000-0000-0000000011065</guid><description><![CDATA[ <p>I have updated db.AddToMovies to db.AddToMovie, Now getting error:</p><p></p><p>&quot;Unable to update the EntitySet &#39;Movie&#39; because it has a DefiningQuery and no &lt;InsertFunction&gt; element exists in the &lt;ModificationFunctionMapping&gt; element to support the current operation.&quot;</p>]]></description><enclosure length="0" type="image/png" url="http://i2.asp.net/avatar/urenjoy.jpg?forceidenticon=false&amp;dt=635046037800000000&amp;enableAvatar=False&amp;cdn_id=2013-05-10-001" /></item><item><title>Comment Posted by sasiatia</title><link>http://asp.net/mvc/tutorials/older-versions/getting-started-with-mvc/getting-started-with-mvc-part6</link><pubDate>Sat, 01 Jan 2011 07:32:10 GMT</pubDate><guid isPermaLink="false">00000000-0000-0000-0000000011382</guid><description><![CDATA[ <p>datatype for price as has been mentioned, screen shoot needs to be replaced</p><p>deciaml(18,2)</p>]]></description><enclosure length="0" type="image/png" url="http://i3.asp.net/avatar/sasiatia.jpg?forceidenticon=false&amp;dt=635046037800000000&amp;enableAvatar=False&amp;cdn_id=2013-05-10-001" /></item><item><title>Comment Posted by dennis_s</title><link>http://asp.net/mvc/tutorials/older-versions/getting-started-with-mvc/getting-started-with-mvc-part6</link><pubDate>Tue, 22 Mar 2011 05:14:23 GMT</pubDate><guid isPermaLink="false">00000000-0000-0000-0000000012566</guid><description><![CDATA[ <p>This fails when I run it.</p><p></p><p>There is no SaveChanges method in the class MvcMovie.Designer.cs,</p><p>so the ocde fails on this line:</p><p> in MoviesController.cs/db.SaveChanges();</p><p>This automatically-generated code is calling a function which does not exist(SaveChanges).</p><p></p><p>Error mesage:</p><p>System.Data.UpdateException was unhandled by user code</p><p>  Message=&quot;Unable to update the EntitySet &#39;Movie&#39; because it has a DefiningQuery and no &lt;InsertFunction&gt; element exists in the &lt;ModificationFunctionMapping&gt; element to support the current operation.&quot;</p><p>  Source=&quot;System.Data.Entity&quot;</p><p>  StackTrace:</p><p>       at System.Data.SqlClient.SqlGen.DmlSqlGenerator.ExpressionTranslator.Visit(DbScanExpression expression)</p><p>       at System.Data.Common.CommandTrees.DbScanExpression.Accept(DbExpressionVisitor visitor)</p><p>       at System.Data.SqlClient.SqlGen.DmlSqlGenerator.GenerateInsertSql(DbInsertCommandTree tree, SqlVersion sqlVersion, List`1&amp; parameters)</p><p>       at System.Data.SqlClient.SqlGen.SqlGenerator.GenerateSql(DbCommandTree tree, SqlVersion sqlVersion, List`1&amp; parameters, CommandType&amp; commandType)</p><p>       at System.Data.SqlClient.SqlProviderServices.CreateCommand(DbProviderManifest providerManifest, DbCommandTree commandTree)</p><p>       at System.Data.SqlClient.SqlProviderServices.CreateCommand(DbCommandTree commandTree)</p><p>       at System.Data.Mapping.Update.Internal.UpdateTranslator.CreateCommand(DbModificationCommandTree commandTree)</p><p>       at System.Data.Mapping.Update.Internal.DynamicUpdateCommand.CreateCommand(UpdateTranslator translator, Dictionary`2 identifierValues)</p><p>       at System.Data.Mapping.Update.Internal.DynamicUpdateCommand.Execute(UpdateTranslator translator, EntityConnection connection, Dictionary`2 identifierValues, List`1 generatedValues)</p><p>       at System.Data.Mapping.Update.Internal.UpdateTranslator.Update(IEntityStateManager stateManager, IEntityAdapter adapter)</p><p>       at System.Data.EntityClient.EntityAdapter.Update(IEntityStateManager entityCache)</p><p>       at System.Data.Objects.ObjectContext.SaveChanges(Boolean acceptChangesDuringSave)</p><p>       at System.Data.Objects.ObjectContext.SaveChanges()</p><p>       at MvcMovie.Controllers.MoviesController.Create(Movie newMovie) in C:\VisStudio_2008_Projects\MvcMovie\MvcMovie\Controllers\MoviesController.cs:line 37</p><p>       at lambda_method(ExecutionScope , ControllerBase , Object[] )</p><p>       at System.Web.Mvc.ActionMethodDispatcher.Execute(ControllerBase controller, Object[] parameters)</p><p>       at System.Web.Mvc.ReflectedActionDescriptor.Execute(ControllerContext controllerContext, IDictionary`2 parameters)</p><p>       at System.Web.Mvc.ControllerActionInvoker.InvokeActionMethod(ControllerContext controllerContext, ActionDescriptor actionDescriptor, IDictionary`2 parameters)</p><p>       at System.Web.Mvc.ControllerActionInvoker.&lt;&gt;c__DisplayClassd.&lt;InvokeActionMethodWithFilters&gt;b__a()</p><p>       at System.Web.Mvc.ControllerActionInvoker.InvokeActionMethodFilter(IActionFilter filter, ActionExecutingContext preContext, Func`1 continuation)</p><p>  InnerException: </p><p>---</p><p></p>]]></description><enclosure length="0" type="image/png" url="http://i3.asp.net/avatar/dennis_s.jpg?forceidenticon=false&amp;dt=635046037800000000&amp;enableAvatar=False&amp;cdn_id=2013-05-10-001" /></item><item><title>Comment Posted by lmpampaletakis</title><link>http://asp.net/mvc/tutorials/older-versions/getting-started-with-mvc/getting-started-with-mvc-part6</link><pubDate>Tue, 22 Mar 2011 09:52:49 GMT</pubDate><guid isPermaLink="false">00000000-0000-0000-0000000012567</guid><description><![CDATA[ <p>[AcceptVerbs(HttpVerbs.Post)]</p><p>        public ActionResult Create(Movie newMovie)</p><p>        {</p><p>            if (ModelState.IsValid)</p><p>            {</p><p>                db.AddToMovie(newMovie);</p><p>                db.SaveChanges();</p><p>                return RedirectToAction(&quot;Index&quot;);</p><p>            }</p><p>            else</p><p>            {</p><p>                return View(newMovie);</p>]]></description><enclosure length="0" type="image/png" url="http://i1.asp.net/avatar/lmpampaletakis.jpg?forceidenticon=false&amp;dt=635046037800000000&amp;enableAvatar=False&amp;cdn_id=2013-05-10-001" /></item><item><title>Comment Posted by dennis_s</title><link>http://asp.net/mvc/tutorials/older-versions/getting-started-with-mvc/getting-started-with-mvc-part6</link><pubDate>Sat, 26 Mar 2011 14:24:41 GMT</pubDate><guid isPermaLink="false">00000000-0000-0000-0000000012621</guid><description><![CDATA[ <p>Solution to issue above:</p><p>In Server Explorer Window&gt;DataConnections, Rt. click the table, Movies, and select Table Definition. Make the Id column the Primary Key. (Should have done that eralier in the process, but its OK - I learned something.) Now, in the Solution Explorer, open(db clk) the file called MovieEntities.edmx. This window shows you a gui to mod your connection to the Movie DB table. Rt. Clk on Id column, nad select Update Model from Database. Now your C# app knows that Movie has a Primary key - the Id column. Since it knows there is a PK defined, when you create a form to Create a new movie, you will now have the option show up in the View Content drop-down meny on hte Add View Wizard window. Since you can select this &#39;Create&#39; option, all the code for creating the form will be auto-magically written for you. </p>]]></description><enclosure length="0" type="image/png" url="http://i3.asp.net/avatar/dennis_s.jpg?forceidenticon=false&amp;dt=635046037800000000&amp;enableAvatar=False&amp;cdn_id=2013-05-10-001" /></item><item><title>Comment Posted by tjtvstj</title><link>http://asp.net/mvc/tutorials/older-versions/getting-started-with-mvc/getting-started-with-mvc-part6</link><pubDate>Mon, 21 Nov 2011 05:13:06 GMT</pubDate><guid isPermaLink="false">00000000-0000-0000-0000000014663</guid><description><![CDATA[ <p>For those who are unable to find db.AddToMovies</p><p>Actually the function is db.AddTo&quot;Tablename&quot;() if your table name is Movies then you can give </p><p>db.AddToMovies</p>]]></description><enclosure length="0" type="image/png" url="http://i1.asp.net/avatar/tjtvstj.jpg?forceidenticon=false&amp;dt=635046037800000000&amp;enableAvatar=False&amp;cdn_id=2013-05-10-001" /></item><item><title>Comment Posted by pgk511</title><link>http://asp.net/mvc/tutorials/older-versions/getting-started-with-mvc/getting-started-with-mvc-part6</link><pubDate>Sat, 01 Dec 2012 23:01:34 GMT</pubDate><guid isPermaLink="false">00000000-0000-0000-0000000016911</guid><description><![CDATA[ <p>Hi Scott, I am Gopala Can i please get the completed project of the movies example</p>]]></description><enclosure length="0" type="image/png" url="http://i1.asp.net/avatar/pgk511.jpg?forceidenticon=false&amp;dt=635046037800000000&amp;enableAvatar=False&amp;cdn_id=2013-05-10-001" /></item></channel></rss>