<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>Getting Started with ASP.NET 4.5 Web Forms - Create the Data Access Layer</title><link>http://www.asp.net</link><pubDate>Thu, 25 Apr 2013 17:09:53 GMT</pubDate><generator>umbraco</generator><description>Comments for Getting Started with ASP.NET 4.5 Web Forms - Create the Data Access Layer</description><language>en</language><atom:link href="http://www.asp.net/rss/comments/37914" rel="self" type="application/rss+xml" /><item><title>Comment Posted by bfallar3</title><link>http://www.asp.net/web-forms/tutorials/aspnet-45/getting-started-with-aspnet-45-web-forms/create_the_data_access_layer</link><pubDate>Fri, 24 Aug 2012 05:37:19 GMT</pubDate><guid isPermaLink="false">00000000-0000-0000-0000000016274</guid><description><![CDATA[ <p>The ProductDatabaseInitializer custom class does not work with VS 2012 RTM, please refer to this blog to make this work, <a rel="nofollow" href="http://www.codeguru.com/csharp/article.php/c19999/Understanding-Database-Initializers-in-Entity-Framework-Code-First.htm" target="_blank">www.codeguru.com/</a></p>]]></description><enclosure length="0" type="image/png" url="http://i2.asp.net/avatar/bfallar3.jpg?forceidenticon=false&amp;dt=635045883600000000&amp;enableAvatar=False&amp;cdn_id=2013-05-10-001" /></item><item><title>Comment Posted by Jason.Redwood</title><link>http://www.asp.net/web-forms/tutorials/aspnet-45/getting-started-with-aspnet-45-web-forms/create_the_data_access_layer</link><pubDate>Sun, 09 Sep 2012 01:12:03 GMT</pubDate><guid isPermaLink="false">00000000-0000-0000-0000000016398</guid><description><![CDATA[ <p>Copied word for word and I have 9 build errors. I&#39;m using VS 11 RC. Is there a reference or something vital that I require in this version. Errors include:</p><p>Error	1	The name &#39;Database&#39; does not exist in the current context</p><p>Error	2	The type or namespace name &#39;DropCreateDatabaseIfModelChanges&#39; could not be found (are you missing a using directive or an assembly reference?)</p><p>Error	3	The best overloaded method match for &#39;System.Collections.Generic.List&lt;WingtipToys.Models.Category&gt;.ForEach(System.Action&lt;WingtipToys.Models.Category&gt;)&#39; has some invalid arguments</p><p>Error	4	Argument 1: cannot convert from &#39;lambda expression&#39; to &#39;System.Action&lt;WingtipToys.Models.Category&gt;&#39;</p><p>Error	5	The best overloaded method match for &#39;System.Collections.Generic.List&lt;WingtipToys.Models.Product&gt;.ForEach(System.Action&lt;WingtipToys.Models.Product&gt;)&#39; has some invalid arguments	</p><p>Error	6	Argument 1: cannot convert from &#39;lambda expression&#39; to &#39;System.Action&lt;WingtipToys.Models.Product&gt;&#39;</p><p>Error	7	&#39;object&#39; does not contain a constructor that takes 1 arguments</p><p>Error	8	The type or namespace name &#39;DbSet&#39; could not be found (are you missing a using directive or an assembly reference?)</p><p>Error	9	The type or namespace name &#39;DbSet&#39; could not be found (are you missing a using directive or an assembly reference?)</p>]]></description><enclosure length="0" type="image/png" url="http://i2.asp.net/avatar/Jason.Redwood.jpg?forceidenticon=false&amp;dt=635045883600000000&amp;enableAvatar=False&amp;cdn_id=2013-05-10-001" /></item><item><title>Comment Posted by Jason.Redwood</title><link>http://www.asp.net/web-forms/tutorials/aspnet-45/getting-started-with-aspnet-45-web-forms/create_the_data_access_layer</link><pubDate>Sun, 09 Sep 2012 01:38:26 GMT</pubDate><guid isPermaLink="false">00000000-0000-0000-0000000016399</guid><description><![CDATA[ <p>Sorted. I found I had to reference the EntityFramework.dll which in installed via NuGet. Cheers</p>]]></description><enclosure length="0" type="image/png" url="http://i2.asp.net/avatar/Jason.Redwood.jpg?forceidenticon=false&amp;dt=635045883600000000&amp;enableAvatar=False&amp;cdn_id=2013-05-10-001" /></item><item><title>Comment Posted by omer gokcek</title><link>http://www.asp.net/web-forms/tutorials/aspnet-45/getting-started-with-aspnet-45-web-forms/create_the_data_access_layer</link><pubDate>Mon, 10 Sep 2012 08:58:32 GMT</pubDate><guid isPermaLink="false">00000000-0000-0000-0000000016406</guid><description><![CDATA[ <p>This tutorial is really great, compare to the previous one.  I would like to ask what to do to populate the data in the sql 2012 management studio  instead of a *.mdf file. Will it be enough to change just the web config file? </p><p>Kind Regards,</p>]]></description><enclosure length="0" type="image/png" url="http://i3.asp.net/avatar/omer%20gokcek.jpg?forceidenticon=false&amp;dt=635045883600000000&amp;enableAvatar=False&amp;cdn_id=2013-05-10-001" /></item><item><title>Comment Posted by yomiyusuf</title><link>http://www.asp.net/web-forms/tutorials/aspnet-45/getting-started-with-aspnet-45-web-forms/create_the_data_access_layer</link><pubDate>Fri, 02 Nov 2012 13:07:55 GMT</pubDate><guid isPermaLink="false">00000000-0000-0000-0000000016734</guid><description><![CDATA[ <p>Hi, Thanks for the tutorial but i have been stuck on the ProductContext.cs. for days. I cannot get it to work.</p><p></p><p>The DBcontext gets underlined in red (meaning its not a recognized class, i assume)</p><p>Wat do i do please.</p><p></p><p>i use VS 2012 RC</p>]]></description><enclosure length="0" type="image/png" url="http://i1.asp.net/avatar/yomiyusuf.jpg?forceidenticon=false&amp;dt=635045883600000000&amp;enableAvatar=False&amp;cdn_id=2013-05-10-001" /></item><item><title>Comment Posted by yomiyusuf</title><link>http://www.asp.net/web-forms/tutorials/aspnet-45/getting-started-with-aspnet-45-web-forms/create_the_data_access_layer</link><pubDate>Fri, 02 Nov 2012 13:25:38 GMT</pubDate><guid isPermaLink="false">00000000-0000-0000-0000000016735</guid><description><![CDATA[ <p>oops, solved it. </p><p>i used the Package Manager Console to get the EntityFramework.</p><p>Works like magic.</p>]]></description><enclosure length="0" type="image/png" url="http://i1.asp.net/avatar/yomiyusuf.jpg?forceidenticon=false&amp;dt=635045883600000000&amp;enableAvatar=False&amp;cdn_id=2013-05-10-001" /></item><item><title>Comment Posted by jjobcorp</title><link>http://www.asp.net/web-forms/tutorials/aspnet-45/getting-started-with-aspnet-45-web-forms/create_the_data_access_layer</link><pubDate>Tue, 06 Nov 2012 09:28:53 GMT</pubDate><guid isPermaLink="false">00000000-0000-0000-0000000016751</guid><description><![CDATA[ <p>I receive no notice when I try to build and when I run through it in debug, it does not build a database.   I suspect this might be because I am using sql express, but am not sure.</p>]]></description><enclosure length="0" type="image/png" url="http://i3.asp.net/avatar/jjobcorp.jpg?forceidenticon=false&amp;dt=635045883600000000&amp;enableAvatar=False&amp;cdn_id=2013-05-10-001" /></item><item><title>Comment Posted by erikreitan</title><link>http://www.asp.net/web-forms/tutorials/aspnet-45/getting-started-with-aspnet-45-web-forms/create_the_data_access_layer</link><pubDate>Tue, 06 Nov 2012 18:06:27 GMT</pubDate><guid isPermaLink="false">00000000-0000-0000-0000000016753</guid><description><![CDATA[ <p>Hi jjobcorp,</p><p></p><p>The Entity Framework will generate the database when the application is run the first time because the Application_Start method contained in the global.asax.cs file will call the initializer class. The initializer class will use the model classes (Category and Product) that you add during this tutorial series to create the database.</p><p></p><p>Please take a look at the &quot;Running the Application and Creating the Database&quot; section in the &quot;UI and Navigation&quot; tutorial of this series. Thanks</p><p></p><p>Erik</p>]]></description><enclosure length="0" type="image/png" url="http://i2.asp.net/avatar/erikreitan.jpg?forceidenticon=false&amp;dt=635045883600000000&amp;enableAvatar=False&amp;cdn_id=2013-05-10-001" /></item><item><title>Comment Posted by developer_aspx</title><link>http://www.asp.net/web-forms/tutorials/aspnet-45/getting-started-with-aspnet-45-web-forms/create_the_data_access_layer</link><pubDate>Fri, 23 Nov 2012 20:45:17 GMT</pubDate><guid isPermaLink="false">00000000-0000-0000-0000000016868</guid><description><![CDATA[ <p>My browser does not show any code highlited in yellow for Global.asax.cs modification even though I am using IE 9. How do I identify the codes?</p><p>My error is &quot;BundeConfig and AuthConfig do not exist in the current context.</p>]]></description><enclosure length="0" type="image/png" url="http://i2.asp.net/avatar/developer_aspx.jpg?forceidenticon=false&amp;dt=635045883600000000&amp;enableAvatar=False&amp;cdn_id=2013-05-10-001" /></item><item><title>Comment Posted by BforBrilliance</title><link>http://www.asp.net/web-forms/tutorials/aspnet-45/getting-started-with-aspnet-45-web-forms/create_the_data_access_layer</link><pubDate>Wed, 05 Dec 2012 13:42:16 GMT</pubDate><guid isPermaLink="false">00000000-0000-0000-0000000016941</guid><description><![CDATA[ <p>In order to add the Reference for System.Data.Entity you have to Right-Click the project name and scroll down to Add Reference. I know that seems like a remedial addition but it took me FOREVER to realize you mean Right-Click YOUR PROJECT TITLE to see the menu where Add Reference is locates.... *sweating at this point lol*</p>]]></description><enclosure length="0" type="image/png" url="http://i2.asp.net/avatar/BforBrilliance.jpg?forceidenticon=false&amp;dt=635045883600000000&amp;enableAvatar=False&amp;cdn_id=2013-05-10-001" /></item><item><title>Comment Posted by IbrahimHasan</title><link>http://www.asp.net/web-forms/tutorials/aspnet-45/getting-started-with-aspnet-45-web-forms/create_the_data_access_layer</link><pubDate>Tue, 11 Dec 2012 12:30:45 GMT</pubDate><guid isPermaLink="false">00000000-0000-0000-0000000016984</guid><description><![CDATA[ <p>Thanks to Erik , but i felt its an advanced tutorial .</p><p></p><p>Hi , Developer_aspx ... I faced the same problem , in Global.asx , add the following lines only , and it will work </p><p></p><p>using System.Data.Entity;</p><p>using WingtipToys.Models;</p><p>Database.SetInitializer(new ProductDatabaseInitialize</p><p></p><p>these are the yellow lines ..</p><p></p>]]></description><enclosure length="0" type="image/png" url="http://i2.asp.net/avatar/IbrahimHasan.jpg?forceidenticon=false&amp;dt=635045883600000000&amp;enableAvatar=False&amp;cdn_id=2013-05-10-001" /></item><item><title>Comment Posted by asadazmat</title><link>http://www.asp.net/web-forms/tutorials/aspnet-45/getting-started-with-aspnet-45-web-forms/create_the_data_access_layer</link><pubDate>Fri, 14 Dec 2012 04:28:01 GMT</pubDate><guid isPermaLink="false">00000000-0000-0000-0000000017003</guid><description><![CDATA[ <p>Thanks Erik.</p>]]></description><enclosure length="0" type="image/png" url="http://i2.asp.net/avatar/asadazmat.jpg?forceidenticon=false&amp;dt=635045883600000000&amp;enableAvatar=False&amp;cdn_id=2013-05-10-001" /></item><item><title>Comment Posted by rschnitzer</title><link>http://www.asp.net/web-forms/tutorials/aspnet-45/getting-started-with-aspnet-45-web-forms/create_the_data_access_layer</link><pubDate>Fri, 25 Jan 2013 11:29:52 GMT</pubDate><guid isPermaLink="false">00000000-0000-0000-0000000018250</guid><description><![CDATA[ <p>At this point in the project there are now two database files.</p><p>Can you give some direction on how I would integrate the new data model in with the membership database that was originally created?</p>]]></description><enclosure length="0" type="image/png" url="http://i1.asp.net/avatar/rschnitzer.jpg?forceidenticon=false&amp;dt=635045883600000000&amp;enableAvatar=False&amp;cdn_id=2013-05-10-001" /></item><item><title>Comment Posted by WardahKafeel</title><link>http://www.asp.net/web-forms/tutorials/aspnet-45/getting-started-with-aspnet-45-web-forms/create_the_data_access_layer</link><pubDate>Sun, 27 Jan 2013 05:33:44 GMT</pubDate><guid isPermaLink="false">00000000-0000-0000-0000000018258</guid><description><![CDATA[ <p>Are model classes necessory ...? i mean  I can add new record and get data from database without model classes.. is this right aproach?</p>]]></description><enclosure length="0" type="image/png" url="http://i3.asp.net/avatar/WardahKafeel.jpg?forceidenticon=false&amp;dt=635045883600000000&amp;enableAvatar=False&amp;cdn_id=2013-05-10-001" /></item><item><title>Comment Posted by kevinhagyard</title><link>http://www.asp.net/web-forms/tutorials/aspnet-45/getting-started-with-aspnet-45-web-forms/create_the_data_access_layer</link><pubDate>Wed, 30 Jan 2013 19:31:07 GMT</pubDate><guid isPermaLink="false">00000000-0000-0000-0000000018285</guid><description><![CDATA[ <p>I would have preferred this tutorial (asp.net 4.5) proceed like the version 4.0 one of Tom Dykstra&#39;s did, starting with a database and creating the entity framework from it.  It seems like a more logical approach to solve an E-Commerce problem with a database first methodology.</p>]]></description><enclosure length="0" type="image/png" url="http://i1.asp.net/avatar/kevinhagyard.jpg?forceidenticon=false&amp;dt=635045883600000000&amp;enableAvatar=False&amp;cdn_id=2013-05-10-001" /></item><item><title>Comment Posted by CeeCon</title><link>http://www.asp.net/web-forms/tutorials/aspnet-45/getting-started-with-aspnet-45-web-forms/create_the_data_access_layer</link><pubDate>Fri, 01 Mar 2013 23:38:16 GMT</pubDate><guid isPermaLink="false">00000000-0000-0000-0000000018556</guid><description><![CDATA[ <p>You&#39;ve missed the part of adding a reference to System.Data.Entity in the References folder.</p>]]></description><enclosure length="0" type="image/png" url="http://i2.asp.net/avatar/CeeCon.jpg?forceidenticon=false&amp;dt=635045883600000000&amp;enableAvatar=False&amp;cdn_id=2013-05-10-001" /></item><item><title>Comment Posted by darrenst</title><link>http://www.asp.net/web-forms/tutorials/aspnet-45/getting-started-with-aspnet-45-web-forms/create_the_data_access_layer</link><pubDate>Thu, 07 Mar 2013 06:19:29 GMT</pubDate><guid isPermaLink="false">00000000-0000-0000-0000000018599</guid><description><![CDATA[ <p>Hi Erik,</p><p></p><p>This works great with a local DB, however how would we port to a local SQL Server or (in my case) a Azure DB.</p><p></p><p>Using code first migrations creates the tables but doesn&#39;t seed the data.</p><p></p><p>Any help would be greatly appreciated.</p><p></p>]]></description><enclosure length="0" type="image/png" url="http://i3.asp.net/avatar/darrenst.jpg?forceidenticon=false&amp;dt=635045883600000000&amp;enableAvatar=False&amp;cdn_id=2013-05-10-001" /></item><item><title>Comment Posted by candidsharp</title><link>http://www.asp.net/web-forms/tutorials/aspnet-45/getting-started-with-aspnet-45-web-forms/create_the_data_access_layer</link><pubDate>Thu, 28 Mar 2013 14:12:24 GMT</pubDate><guid isPermaLink="false">00000000-0000-0000-0000000018797</guid><description><![CDATA[ <p>When I build this I got this error.</p><p>Inconsistent accessibility: property type &#39;WingTipToys.Models.Category&#39; is less accessible than property &#39;WingTipToys.Models.Product.Category&#39;	</p><p></p><p>Any idea whats wroong?</p>]]></description><enclosure length="0" type="image/png" url="http://i1.asp.net/avatar/candidsharp.jpg?forceidenticon=false&amp;dt=635045883600000000&amp;enableAvatar=False&amp;cdn_id=2013-05-10-001" /></item><item><title>Comment Posted by candidsharp</title><link>http://www.asp.net/web-forms/tutorials/aspnet-45/getting-started-with-aspnet-45-web-forms/create_the_data_access_layer</link><pubDate>Thu, 28 Mar 2013 14:24:04 GMT</pubDate><guid isPermaLink="false">00000000-0000-0000-0000000018798</guid><description><![CDATA[ <p>Sorry I fixed it... the Category class was not declared as public. </p>]]></description><enclosure length="0" type="image/png" url="http://i1.asp.net/avatar/candidsharp.jpg?forceidenticon=false&amp;dt=635045883600000000&amp;enableAvatar=False&amp;cdn_id=2013-05-10-001" /></item><item><title>Comment Posted by afiq</title><link>http://www.asp.net/web-forms/tutorials/aspnet-45/getting-started-with-aspnet-45-web-forms/create_the_data_access_layer</link><pubDate>Mon, 08 Apr 2013 12:27:00 GMT</pubDate><guid isPermaLink="false">00000000-0000-0000-0000000018875</guid><description><![CDATA[ <p>I am currently trying to modified the database so that it can calculate stock to. Can you guide me on how to change this database into an inventory stock management... please</p>]]></description><enclosure length="0" type="image/png" url="http://i1.asp.net/avatar/afiq.jpg?forceidenticon=false&amp;dt=635045883600000000&amp;enableAvatar=False&amp;cdn_id=2013-05-10-001" /></item><item><title>Comment Posted by tcm2</title><link>http://www.asp.net/web-forms/tutorials/aspnet-45/getting-started-with-aspnet-45-web-forms/create_the_data_access_layer</link><pubDate>Thu, 25 Apr 2013 14:29:00 GMT</pubDate><guid isPermaLink="false">00000000-0000-0000-0000000018982</guid><description><![CDATA[ <p>I am having trouble updating the Global.asax.cs file.  My specific problem is adding &quot;using WingTipToys.Models;&quot;  Models is underlined in red, the only intelisense choice is &quot;Account.&quot;</p><p></p><p>On build the error message says ...&quot;Models&quot; does not exist in the namespace &quot;WingtopToys&quot;...  The folder is there and populated per the tutorial.</p><p></p><p>Also, I ma hand coding into VS2010 because I am not sure I have room for add VS2012 right now.</p>]]></description><enclosure length="0" type="image/png" url="http://i1.asp.net/avatar/tcm2.jpg?forceidenticon=false&amp;dt=635045883600000000&amp;enableAvatar=False&amp;cdn_id=2013-05-10-001" /></item><item><title>Comment Posted by tcm2</title><link>http://www.asp.net/web-forms/tutorials/aspnet-45/getting-started-with-aspnet-45-web-forms/create_the_data_access_layer</link><pubDate>Thu, 25 Apr 2013 17:09:53 GMT</pubDate><guid isPermaLink="false">00000000-0000-0000-0000000018985</guid><description><![CDATA[ <p>Got it.  Used &quot;tmWingtipToys&quot; as the name of my project and hand keyed in most of the tutorial code.  But I got to a point where I cut and pasted in some to speed up the process.  The cut and paste parts used &quot;WingtipToy&quot; for the namespace.</p><p></p><p>What I learned here is the folders are part of the namespace used in the classes. </p>]]></description><enclosure length="0" type="image/png" url="http://i1.asp.net/avatar/tcm2.jpg?forceidenticon=false&amp;dt=635045883600000000&amp;enableAvatar=False&amp;cdn_id=2013-05-10-001" /></item></channel></rss>