<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 Model</title><link>http://www.asp.net</link><pubDate>Thu, 28 Feb 2013 04:32:21 GMT</pubDate><generator>umbraco</generator><description>Comments for Adding a Model</description><language>en</language><atom:link href="http://www.asp.net/rss/comments/37156" rel="self" type="application/rss+xml" /><item><title>Comment Posted by juliandormon</title><link>http://www.asp.net/mvc/tutorials/mvc-4/getting-started-with-aspnet-mvc4/adding-a-model</link><pubDate>Mon, 20 Aug 2012 18:02:44 GMT</pubDate><guid isPermaLink="false">00000000-0000-0000-0000000016227</guid><description><![CDATA[ <p>Actually I figured it out. I had pasted the argumnt class outside of the Mvc.Models namespace.</p>]]></description><enclosure length="0" type="image/png" url="http://i3.asp.net/avatar/juliandormon.jpg?forceidenticon=false&amp;dt=635047795800000000&amp;enableAvatar=False&amp;cdn_id=2013-05-10-001" /></item><item><title>Comment Posted by pepsibot</title><link>http://www.asp.net/mvc/tutorials/mvc-4/getting-started-with-aspnet-mvc4/adding-a-model</link><pubDate>Mon, 27 Aug 2012 20:42:36 GMT</pubDate><guid isPermaLink="false">00000000-0000-0000-0000000016314</guid><description><![CDATA[ <p>In my situation the example given above for the connectionString does not work in Microsoft Visual Studio 2010 Pro.</p><p>The project will build but when I attempt to navigate to /Movies I am be greeted by an InvalidOperationException that reads &quot;Unable to complete the operation.  The supplied SqlConnection does not specify an initial Catalog.&quot;</p><p></p><p>The connectionString should equal &quot;Data Source=(LocalDB)\v11.0;AttachDbFilename=|DataDirectory|\Movies.mdf;Initial Catalog=Movies;Integrated Security=True&quot;;</p>]]></description><enclosure length="0" type="image/png" url="http://i2.asp.net/avatar/pepsibot.jpg?forceidenticon=false&amp;dt=635047795800000000&amp;enableAvatar=False&amp;cdn_id=2013-05-10-001" /></item><item><title>Comment Posted by ricka6</title><link>http://www.asp.net/mvc/tutorials/mvc-4/getting-started-with-aspnet-mvc4/adding-a-model</link><pubDate>Tue, 28 Aug 2012 14:44:52 GMT</pubDate><guid isPermaLink="false">00000000-0000-0000-0000000016327</guid><description><![CDATA[ <p>@pepsibot connectionString does not work in Visual Studio 2010 Pro.</p><p>--You need to install LocalDB and SSDT as described in the tutorial.</p>]]></description><enclosure length="0" type="image/png" url="http://i1.asp.net/avatar/ricka6.jpg?forceidenticon=false&amp;dt=635047795800000000&amp;enableAvatar=False&amp;cdn_id=2013-05-10-001" /></item><item><title>Comment Posted by peter klein</title><link>http://www.asp.net/mvc/tutorials/mvc-4/getting-started-with-aspnet-mvc4/adding-a-model</link><pubDate>Thu, 30 Aug 2012 07:49:29 GMT</pubDate><guid isPermaLink="false">00000000-0000-0000-0000000016348</guid><description><![CDATA[ <p>Hi Rick, Thanks for this excellent tutorial. I have been following you ever since 2010 with all variants of the tutorial. This week I installed VS 2010, which comes with .NET Framework 4.5. I do not succeed with the &quot;using System.Data.Entity; &quot;. I seems not to be there in 4.5</p><p>Is it advisable to simply move backwards to EF 4.0?</p><p></p><p>Best regards,</p><p>Peter Klein </p>]]></description><enclosure length="0" type="image/png" url="http://i3.asp.net/avatar/peter%20klein.jpg?forceidenticon=false&amp;dt=635047795800000000&amp;enableAvatar=False&amp;cdn_id=2013-05-10-001" /></item><item><title>Comment Posted by peter klein</title><link>http://www.asp.net/mvc/tutorials/mvc-4/getting-started-with-aspnet-mvc4/adding-a-model</link><pubDate>Thu, 30 Aug 2012 07:50:43 GMT</pubDate><guid isPermaLink="false">00000000-0000-0000-0000000016349</guid><description><![CDATA[ <p>Sorry, slip of the keyboard: of course I mean: I have installed VC 2012!!</p>]]></description><enclosure length="0" type="image/png" url="http://i3.asp.net/avatar/peter%20klein.jpg?forceidenticon=false&amp;dt=635047795800000000&amp;enableAvatar=False&amp;cdn_id=2013-05-10-001" /></item><item><title>Comment Posted by vijayan.kandasamy</title><link>http://www.asp.net/mvc/tutorials/mvc-4/getting-started-with-aspnet-mvc4/adding-a-model</link><pubDate>Fri, 02 Nov 2012 11:41:37 GMT</pubDate><guid isPermaLink="false">00000000-0000-0000-0000000016733</guid><description><![CDATA[ <p>@Peter Klein - Change the connection string in MovieDBContext as below.</p><p></p><p> &lt;add name=&quot;MovieDBContext&quot;</p><p>   connectionString=&quot;Data Source=(LocalDB)\v11.0; Initial Catalog=aspnet-MvcMovie-2012213181139; AttachDbFilename=|DataDirectory|\Movies.mdf;Integrated Security=True&quot;</p><p>   providerName=&quot;System.Data.SqlClient&quot;</p><p>/&gt;</p>]]></description><enclosure length="0" type="image/png" url="http://i3.asp.net/avatar/vijayan.kandasamy.jpg?forceidenticon=false&amp;dt=635047795800000000&amp;enableAvatar=False&amp;cdn_id=2013-05-10-001" /></item><item><title>Comment Posted by gmsteele44</title><link>http://www.asp.net/mvc/tutorials/mvc-4/getting-started-with-aspnet-mvc4/adding-a-model</link><pubDate>Thu, 08 Nov 2012 12:10:17 GMT</pubDate><guid isPermaLink="false">00000000-0000-0000-0000000016764</guid><description><![CDATA[ <p>@nicka6 - I had both of those installed and still needed to specify an initial catalog. I think it&#39;s a 2010 thing :-(</p>]]></description><enclosure length="0" type="image/png" url="http://i1.asp.net/avatar/gmsteele44.jpg?forceidenticon=false&amp;dt=635047795800000000&amp;enableAvatar=False&amp;cdn_id=2013-05-10-001" /></item><item><title>Comment Posted by garfieldzf</title><link>http://www.asp.net/mvc/tutorials/mvc-4/getting-started-with-aspnet-mvc4/adding-a-model</link><pubDate>Sun, 25 Nov 2012 19:55:39 GMT</pubDate><guid isPermaLink="false">00000000-0000-0000-0000000016871</guid><description><![CDATA[ <p>This demo have no info about Pagination in MVC4.</p>]]></description><enclosure length="0" type="image/png" url="http://i2.asp.net/avatar/garfieldzf.jpg?forceidenticon=false&amp;dt=635047795800000000&amp;enableAvatar=False&amp;cdn_id=2013-05-10-001" /></item><item><title>Comment Posted by selfay</title><link>http://www.asp.net/mvc/tutorials/mvc-4/getting-started-with-aspnet-mvc4/adding-a-model</link><pubDate>Fri, 14 Dec 2012 06:11:22 GMT</pubDate><guid isPermaLink="false">00000000-0000-0000-0000000017008</guid><description><![CDATA[ <p>Very useful tutorial.</p><p>Thanks</p>]]></description><enclosure length="0" type="image/png" url="http://i3.asp.net/avatar/selfay.jpg?forceidenticon=false&amp;dt=635047795800000000&amp;enableAvatar=False&amp;cdn_id=2013-05-10-001" /></item><item><title>Comment Posted by selfay</title><link>http://www.asp.net/mvc/tutorials/mvc-4/getting-started-with-aspnet-mvc4/adding-a-model</link><pubDate>Fri, 14 Dec 2012 08:15:50 GMT</pubDate><guid isPermaLink="false">00000000-0000-0000-0000000017010</guid><description><![CDATA[ <p>What about Movies.mdf file in the DataDirectory directory?</p><p>Next step will be impossible without these.</p><p>May be follow</p><p>Right click on the folder App_Data=&gt;Add=&gt;New Item=&gt;SQL Server Database </p><p>solve the problem!?</p>]]></description><enclosure length="0" type="image/png" url="http://i3.asp.net/avatar/selfay.jpg?forceidenticon=false&amp;dt=635047795800000000&amp;enableAvatar=False&amp;cdn_id=2013-05-10-001" /></item><item><title>Comment Posted by yaqubonnet</title><link>http://www.asp.net/mvc/tutorials/mvc-4/getting-started-with-aspnet-mvc4/adding-a-model</link><pubDate>Mon, 17 Dec 2012 04:59:59 GMT</pubDate><guid isPermaLink="false">00000000-0000-0000-0000000017021</guid><description><![CDATA[ <p>Hello Anderson,</p><p></p><p>I am confused here! where is the &quot;Movies.mdf&quot;?? i can find it nowhere? </p><p></p><p>Regards</p>]]></description><enclosure length="0" type="image/png" url="http://i3.asp.net/avatar/yaqubonnet.jpg?forceidenticon=false&amp;dt=635047795800000000&amp;enableAvatar=False&amp;cdn_id=2013-05-10-001" /></item><item><title>Comment Posted by yaqubonnet</title><link>http://www.asp.net/mvc/tutorials/mvc-4/getting-started-with-aspnet-mvc4/adding-a-model</link><pubDate>Mon, 17 Dec 2012 06:29:12 GMT</pubDate><guid isPermaLink="false">00000000-0000-0000-0000000017023</guid><description><![CDATA[ <p>The Movies.mdf does not exists, what to do?</p><p></p><p>The Entity Framework will detect that the database connection string that was provided, pointed to a Movies database that didn’t exist yet, it will create the database automatically.</p><p></p><p>Please use this ConnectionString (Initial Catalog=Movies):</p><p></p><p>    &lt;add name=&quot;MovieDBContext&quot; </p><p>         connectionString=&quot;Data Source=(LocalDB)\v11.0;AttachDbFilename=|DataDirectory|\Movies.mdf;Initial Catalog=Movies;Integrated Security=True&quot; </p><p>         providerName=&quot;System.Data.SqlClient&quot;/&gt;</p><p></p><p>Regards</p>]]></description><enclosure length="0" type="image/png" url="http://i3.asp.net/avatar/yaqubonnet.jpg?forceidenticon=false&amp;dt=635047795800000000&amp;enableAvatar=False&amp;cdn_id=2013-05-10-001" /></item><item><title>Comment Posted by navmed</title><link>http://www.asp.net/mvc/tutorials/mvc-4/getting-started-with-aspnet-mvc4/adding-a-model</link><pubDate>Wed, 09 Jan 2013 19:06:39 GMT</pubDate><guid isPermaLink="false">00000000-0000-0000-0000000017148</guid><description><![CDATA[ <p>1. There&#39;s already a default connection string. What is the need for another connection string? </p><p>2. Does every model need it&#39;s own connection string? </p><p>3. Does the name of the connection string need to match the name of the DBContext?</p>]]></description><enclosure length="0" type="image/png" url="http://i3.asp.net/avatar/navmed.jpg?forceidenticon=false&amp;dt=635047795800000000&amp;enableAvatar=False&amp;cdn_id=2013-05-10-001" /></item><item><title>Comment Posted by skillfulweb</title><link>http://www.asp.net/mvc/tutorials/mvc-4/getting-started-with-aspnet-mvc4/adding-a-model</link><pubDate>Thu, 10 Jan 2013 16:41:13 GMT</pubDate><guid isPermaLink="false">00000000-0000-0000-0000000017154</guid><description><![CDATA[ <p>I accidentally added the connection string to the Web.config file in the ~/Views folder.  The project seemed to be working, all the CRUD functioned as expected.  However, no Movies.mdf file (or any *.mdf) was created in the project.  Where was the data being stored?</p><p></p><p>When I corrected the error by moving the connection string to ~/Web.config and rebuilt the project, the Movies db was created but my earlier data vanished (which I expected it would.)</p>]]></description><enclosure length="0" type="image/png" url="http://i3.asp.net/avatar/skillfulweb.jpg?forceidenticon=false&amp;dt=635047795800000000&amp;enableAvatar=False&amp;cdn_id=2013-05-10-001" /></item><item><title>Comment Posted by ricka6</title><link>http://www.asp.net/mvc/tutorials/mvc-4/getting-started-with-aspnet-mvc4/adding-a-model</link><pubDate>Wed, 16 Jan 2013 21:17:29 GMT</pubDate><guid isPermaLink="false">00000000-0000-0000-0000000018187</guid><description><![CDATA[ <p>@navmed Does every model need it&#39;s own connection string? </p><p>No - Does the name of the connection string need to match the name of the DBContext? Yes</p><p>@skillfulweb  I accidentally added the connection string to the Web.config file in the ~/Views folder. </p><p>Probably in the default user directory.</p>]]></description><enclosure length="0" type="image/png" url="http://i1.asp.net/avatar/ricka6.jpg?forceidenticon=false&amp;dt=635047795800000000&amp;enableAvatar=False&amp;cdn_id=2013-05-10-001" /></item><item><title>Comment Posted by unknownx</title><link>http://www.asp.net/mvc/tutorials/mvc-4/getting-started-with-aspnet-mvc4/adding-a-model</link><pubDate>Sun, 27 Jan 2013 17:03:41 GMT</pubDate><guid isPermaLink="false">00000000-0000-0000-0000000018264</guid><description><![CDATA[ <p>Make sure you&#39;re exit debug mode before add the new class. I forgot to exit debug mode so my &#39;class&#39; option was disable when attempt to add a new model class</p>]]></description><enclosure length="0" type="image/png" url="http://i3.asp.net/avatar/unknownx.jpg?forceidenticon=false&amp;dt=635047795800000000&amp;enableAvatar=False&amp;cdn_id=2013-05-10-001" /></item><item><title>Comment Posted by salman_sulaiman_1979</title><link>http://www.asp.net/mvc/tutorials/mvc-4/getting-started-with-aspnet-mvc4/adding-a-model</link><pubDate>Thu, 07 Feb 2013 08:55:26 GMT</pubDate><guid isPermaLink="false">00000000-0000-0000-0000000018368</guid><description><![CDATA[ <p>Hi there Rick and folks!</p><p>amazing tutorial rick!</p><p>Thanks mate!</p><p>I am following up the steps with my Vs2012 express edition on my laptop, so far so good.</p><p></p><p>Thanks once again and good luck folks.</p><p>~Salman~</p>]]></description><enclosure length="0" type="image/png" url="http://i3.asp.net/avatar/salman_sulaiman_1979.jpg?forceidenticon=false&amp;dt=635047795800000000&amp;enableAvatar=False&amp;cdn_id=2013-05-10-001" /></item><item><title>Comment Posted by salman_sulaiman_1979</title><link>http://www.asp.net/mvc/tutorials/mvc-4/getting-started-with-aspnet-mvc4/adding-a-model</link><pubDate>Thu, 07 Feb 2013 11:42:23 GMT</pubDate><guid isPermaLink="false">00000000-0000-0000-0000000018370</guid><description><![CDATA[ <p>evening folks!</p><p>thanks for the tip there Selfay! :-)</p><p></p><p>I enjoy testing and playing around and diverting from the norm path (so to speak) just to see what would I get as a results!</p><p></p><p>once again, thank you Ricka6 for the tips! :)</p><p></p><p>what I did is (so far) is used a connectionString to a test db on my SqlExpress2012, and would like to see how far I would reach with that, of course all that locally on my own machine! just for the sake of it! :-)</p><p>I will have to continue with the next page and see if it works out! mmmm! that what I call fun! </p><p>Good luck folks &amp; I will post my feedback and share it on here as I go along with you guys!</p><p>Best Wishes,</p><p>~Salman~</p>]]></description><enclosure length="0" type="image/png" url="http://i3.asp.net/avatar/salman_sulaiman_1979.jpg?forceidenticon=false&amp;dt=635047795800000000&amp;enableAvatar=False&amp;cdn_id=2013-05-10-001" /></item><item><title>Comment Posted by salman_sulaiman_1979</title><link>http://www.asp.net/mvc/tutorials/mvc-4/getting-started-with-aspnet-mvc4/adding-a-model</link><pubDate>Thu, 07 Feb 2013 12:35:38 GMT</pubDate><guid isPermaLink="false">00000000-0000-0000-0000000018371</guid><description><![CDATA[ <p>Evening folks!</p><p>I would like to share how it went on, with me regarding the ConnectionString.</p><p>on the next tutorial page, Rick explains how the LocalDB under App_Data folder in our VS2012 Solution Explorer, how it gets created automatically on its own once you Debug (F5), and it really works. it created the DB in the App_Data and I can see the Tables (frankly, I am applying  the tutorial on my own simple scenario, in my case I have a list of &quot;Daily Journal Enteries&quot; (instead of a list of movies), I find it much more fun and exciting when applying tutorials with a application (scope or scenario I could relate to or need..I don&#39;t know, that&#39;s  just me!) ...</p><p>alright folks, I will carry on with the next tutorial (much more fun to come with Rick! amazing stuff, this is my first MVC experience). .</p><p>Good luck folks!</p><p>~Salman~</p>]]></description><enclosure length="0" type="image/png" url="http://i3.asp.net/avatar/salman_sulaiman_1979.jpg?forceidenticon=false&amp;dt=635047795800000000&amp;enableAvatar=False&amp;cdn_id=2013-05-10-001" /></item><item><title>Comment Posted by dnathanhood</title><link>http://www.asp.net/mvc/tutorials/mvc-4/getting-started-with-aspnet-mvc4/adding-a-model</link><pubDate>Sun, 10 Feb 2013 09:40:51 GMT</pubDate><guid isPermaLink="false">00000000-0000-0000-0000000018396</guid><description><![CDATA[ <p>I had a permissions issue while creating the database for this step.  I wound up doing a major no-no and just giving &quot;Everyone&quot; write permissions on the directory.  Does anyone know what account is actually being used in this step?</p>]]></description><enclosure length="0" type="image/png" url="http://i1.asp.net/avatar/dnathanhood.jpg?forceidenticon=false&amp;dt=635047795800000000&amp;enableAvatar=False&amp;cdn_id=2013-05-10-001" /></item><item><title>Comment Posted by shamimbd0</title><link>http://www.asp.net/mvc/tutorials/mvc-4/getting-started-with-aspnet-mvc4/adding-a-model</link><pubDate>Mon, 11 Feb 2013 06:18:33 GMT</pubDate><guid isPermaLink="false">00000000-0000-0000-0000000018403</guid><description><![CDATA[ <p>Entity Framework Code First is very nice. </p>]]></description><enclosure length="0" type="image/png" url="http://i1.asp.net/avatar/shamimbd0.jpg?forceidenticon=false&amp;dt=635047795800000000&amp;enableAvatar=False&amp;cdn_id=2013-05-10-001" /></item><item><title>Comment Posted by HRaul</title><link>http://www.asp.net/mvc/tutorials/mvc-4/getting-started-with-aspnet-mvc4/adding-a-model</link><pubDate>Fri, 22 Feb 2013 13:27:32 GMT</pubDate><guid isPermaLink="false">00000000-0000-0000-0000000018498</guid><description><![CDATA[ <p>For VS2010 problem in connectionString, just change to:</p><p>  &lt;add name=&quot;MovieDBContext&quot; </p><p>       connectionString=&quot;Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\Movies.mdf;Integrated Security=True&quot; </p><p>       providerName=&quot;System.Data.SqlClient&quot; </p><p>  /&gt; </p>]]></description><enclosure length="0" type="image/png" url="http://i3.asp.net/avatar/HRaul.jpg?forceidenticon=false&amp;dt=635047795800000000&amp;enableAvatar=False&amp;cdn_id=2013-05-10-001" /></item><item><title>Comment Posted by Stewy777</title><link>http://www.asp.net/mvc/tutorials/mvc-4/getting-started-with-aspnet-mvc4/adding-a-model</link><pubDate>Mon, 25 Feb 2013 05:10:11 GMT</pubDate><guid isPermaLink="false">00000000-0000-0000-0000000018508</guid><description><![CDATA[ <p>Hi All, </p><p></p><p>Can anyone please help - I just went to rebuild the project after editing the web.config file and now I am getting an error which says </p><p>&quot;	Inconsistent accessibility: base class &#39;MvcMovie.Models.DbContext&#39; is less accessible than class &#39;MvcMovie.Models.UsersContext&#39;	&quot;</p><p></p>]]></description><enclosure length="0" type="image/png" url="http://i1.asp.net/avatar/Stewy777.jpg?forceidenticon=false&amp;dt=635047795800000000&amp;enableAvatar=False&amp;cdn_id=2013-05-10-001" /></item><item><title>Comment Posted by Danny117</title><link>http://www.asp.net/mvc/tutorials/mvc-4/getting-started-with-aspnet-mvc4/adding-a-model</link><pubDate>Mon, 25 Feb 2013 19:19:07 GMT</pubDate><guid isPermaLink="false">00000000-0000-0000-0000000018515</guid><description><![CDATA[ <p>I&#39;m with you so far.  I built the project because one user in the coments did this and had a problem.</p><p></p><p>1&gt;------ Build started: Project: MvcMovie, Configuration: Debug Any CPU ------</p><p>1&gt;  MvcMovie -&gt; C:\Users\Dan\Documents\Visual Studio 2012\Projects\MvcMovie\MvcMovie\bin\MvcMovie.dll</p><p>========== Build: 1 succeeded, 0 failed, 0 up-to-date, 0 skipped ==========</p><p></p>]]></description><enclosure length="0" type="image/png" url="http://i1.asp.net/avatar/Danny117.jpg?forceidenticon=false&amp;dt=635047795800000000&amp;enableAvatar=False&amp;cdn_id=2013-05-10-001" /></item><item><title>Comment Posted by Stewy777</title><link>http://www.asp.net/mvc/tutorials/mvc-4/getting-started-with-aspnet-mvc4/adding-a-model</link><pubDate>Thu, 28 Feb 2013 04:32:21 GMT</pubDate><guid isPermaLink="false">00000000-0000-0000-0000000018541</guid><description><![CDATA[ <p>Problem now fixed not sure how !!!!</p>]]></description><enclosure length="0" type="image/png" url="http://i1.asp.net/avatar/Stewy777.jpg?forceidenticon=false&amp;dt=635047795800000000&amp;enableAvatar=False&amp;cdn_id=2013-05-10-001" /></item></channel></rss>