<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>Part 7: Membership and Authorization</title><link>http://asp.net</link><pubDate>Thu, 03 Nov 2011 13:30:55 GMT</pubDate><generator>umbraco</generator><description>Comments for Part 7: Membership and Authorization</description><language>en</language><atom:link href="http://asp.net/rss/comments/27631" rel="self" type="application/rss+xml" /><item><title>Comment Posted by Gilnaa</title><link>http://asp.net/mvc/tutorials/mvc-music-store/mvc-music-store-part-7</link><pubDate>Sat, 14 May 2011 00:03:48 GMT</pubDate><guid isPermaLink="false">00000000-0000-0000-0000000013154</guid><description><![CDATA[ <p>I thought I did all the earlier parts of the guide correctly.</p><p>Apparently not.</p><p></p><p>When I try to connect to the security tab:</p><p>[b]The following message may help in diagnosing the problem: Unable to connect to SQL Server database.[/b]</p>]]></description><enclosure length="0" type="image/png" url="http://i2.asp.net/avatar/Gilnaa.jpg?forceidenticon=false&amp;dt=635045874000000000&amp;enableAvatar=False&amp;cdn_id=2013-05-10-001" /></item><item><title>Comment Posted by pdelco</title><link>http://asp.net/mvc/tutorials/mvc-music-store/mvc-music-store-part-7</link><pubDate>Wed, 18 May 2011 15:26:59 GMT</pubDate><guid isPermaLink="false">00000000-0000-0000-0000000013211</guid><description><![CDATA[ <p>Gilnaa,</p><p></p><p>By default, a SQL Server db is used to store membership data. Check your web.config file for the &quot;membership&quot; and &quot;roleManager&quot; attributes. You should see information about a connection string in each section. You can edit the connection string and try again. </p><p></p><p>Also, you should be able to test your connection via the &quot;Provider&quot; tab.</p><p></p><p>Hope this helps,</p><p></p><p>Paul</p>]]></description><enclosure length="0" type="image/png" url="http://i3.asp.net/avatar/pdelco.jpg?forceidenticon=false&amp;dt=635045874000000000&amp;enableAvatar=False&amp;cdn_id=2013-05-10-001" /></item><item><title>Comment Posted by siriosus</title><link>http://asp.net/mvc/tutorials/mvc-music-store/mvc-music-store-part-7</link><pubDate>Fri, 03 Jun 2011 03:31:40 GMT</pubDate><guid isPermaLink="false">00000000-0000-0000-0000000013376</guid><description><![CDATA[ <p>Gilnaa,</p><p>Paul is right. In this tutorial creates the empty MVC project. That&#39;s why there&#39;s no any connection strings and providers for the autorization functionality in web.config file. You must mannualy add connection strings to this file. For example like this:</p><p></p><p>&lt;connectionStrings&gt;</p><p>    &lt;add name=&quot;MusicStoreEntities&quot; connectionString=&quot;Data Source=|DataDirectory|MvcMusicStore.sdf&quot; providerName=&quot;System.Data.SqlServerCe.4.0&quot;/&gt;</p><p>    &lt;add name=&quot;ApplicationServices&quot;</p><p>        connectionString=&quot;data source=.\;Integrated Security=SSPI;AttachDBFilename=|DataDirectory|aspnetdb.mdf;User Instance=true&quot;</p><p>        providerName=&quot;System.Data.SqlClient&quot; /&gt;</p><p>  &lt;/connectionStrings&gt;</p><p></p><p>this adds a connection info and creates a database attach file. Note : you must specify the name of your instance of SQL Server.</p><p></p><p>And this for membership and roles:</p><p></p><p>&lt;authentication mode=&quot;Forms&quot;&gt;</p><p>      &lt;forms loginUrl=&quot;~/Account/LogOn&quot; timeout=&quot;2880&quot; /&gt;</p><p>    &lt;/authentication&gt;</p><p></p><p>    &lt;membership&gt;</p><p>      &lt;providers&gt;</p><p>        &lt;clear/&gt;</p><p>        &lt;add name=&quot;AspNetSqlMembershipProvider&quot; type=&quot;System.Web.Security.SqlMembershipProvider&quot; connectionStringName=&quot;ApplicationServices&quot;</p><p>             enablePasswordRetrieval=&quot;false&quot; enablePasswordReset=&quot;true&quot; requiresQuestionAndAnswer=&quot;false&quot; requiresUniqueEmail=&quot;false&quot;</p><p>             maxInvalidPasswordAttempts=&quot;5&quot; minRequiredPasswordLength=&quot;6&quot; minRequiredNonalphanumericCharacters=&quot;0&quot; passwordAttemptWindow=&quot;10&quot;</p><p>             applicationName=&quot;/&quot; /&gt;</p><p>      &lt;/providers&gt;</p><p>    &lt;/membership&gt;</p><p></p><p>    &lt;profile&gt;</p><p>      &lt;providers&gt;</p><p>        &lt;clear/&gt;</p><p>        &lt;add name=&quot;AspNetSqlProfileProvider&quot; type=&quot;System.Web.Profile.SqlProfileProvider&quot; connectionStringName=&quot;ApplicationServices&quot; applicationName=&quot;/&quot; /&gt;</p><p>      &lt;/providers&gt;</p><p>    &lt;/profile&gt;</p><p></p><p>    &lt;roleManager enabled=&quot;true&quot;&gt;</p><p>      &lt;providers&gt;</p><p>        &lt;clear /&gt;</p><p>        &lt;add connectionStringName=&quot;ApplicationServices&quot; applicationName=&quot;/&quot;</p><p>          name=&quot;AspNetSqlRoleProvider&quot; type=&quot;System.Web.Security.SqlRoleProvider&quot; /&gt;</p><p>        &lt;add applicationName=&quot;/&quot; name=&quot;AspNetWindowsTokenRoleProvider&quot;</p><p>          type=&quot;System.Web.Security.WindowsTokenRoleProvider&quot; /&gt;</p><p>      &lt;/providers&gt;</p><p>    &lt;/roleManager&gt;</p><p></p><p>Hope this helps!</p>]]></description><enclosure length="0" type="image/png" url="http://i3.asp.net/avatar/siriosus.jpg?forceidenticon=false&amp;dt=635045874000000000&amp;enableAvatar=False&amp;cdn_id=2013-05-10-001" /></item><item><title>Comment Posted by SledGimp</title><link>http://asp.net/mvc/tutorials/mvc-music-store/mvc-music-store-part-7</link><pubDate>Thu, 09 Jun 2011 21:28:33 GMT</pubDate><guid isPermaLink="false">00000000-0000-0000-0000000013471</guid><description><![CDATA[ <p>I have read through this and am getting an error on the line &lt;authentication mode=&quot;Forms&quot;&gt;, please try to help me understand this more.</p>]]></description><enclosure length="0" type="image/png" url="http://i3.asp.net/avatar/SledGimp.jpg?forceidenticon=false&amp;dt=635045874000000000&amp;enableAvatar=False&amp;cdn_id=2013-05-10-001" /></item><item><title>Comment Posted by stevek123</title><link>http://asp.net/mvc/tutorials/mvc-music-store/mvc-music-store-part-7</link><pubDate>Mon, 20 Jun 2011 20:42:19 GMT</pubDate><guid isPermaLink="false">00000000-0000-0000-0000000013568</guid><description><![CDATA[ <p>For some reason, I got an eror when I tried to bring up the StoreManager logon screen at the end of this section.  I fixed it by manually copying the error.aspx, LogOnUserControl.ascx and Site.Master files from the \Views\Shared folder where I created the ASP.NET MVC 2 project at the beginning of this section to the \Views\Shared folder of the MVCMusicStore project and adding them one by one as existing items into the Views/Shared folder of the project.  Add them by right clicking on the Shared folder and selecting Add &gt; Existing Item...</p>]]></description><enclosure length="0" type="image/png" url="http://i2.asp.net/avatar/stevek123.jpg?forceidenticon=false&amp;dt=635045874000000000&amp;enableAvatar=False&amp;cdn_id=2013-05-10-001" /></item><item><title>Comment Posted by mhanson</title><link>http://asp.net/mvc/tutorials/mvc-music-store/mvc-music-store-part-7</link><pubDate>Fri, 15 Jul 2011 21:15:55 GMT</pubDate><guid isPermaLink="false">00000000-0000-0000-0000000013768</guid><description><![CDATA[ <p>stevek123, Create a new ASP.NET MVC application, but instead of a full ASP.NET MVC 2 Web Application template, create a ASP.NET MVC 3 Application.  When the Project templates appear, select the Internet Application template.  This will create the logon files.  Copy these files over.  You still have to change the namespaces.  The errors were a lot easier to track down.</p>]]></description><enclosure length="0" type="image/png" url="http://i1.asp.net/avatar/mhanson.jpg?forceidenticon=false&amp;dt=635045874000000000&amp;enableAvatar=False&amp;cdn_id=2013-05-10-001" /></item><item><title>Comment Posted by wkpham</title><link>http://asp.net/mvc/tutorials/mvc-music-store/mvc-music-store-part-7</link><pubDate>Mon, 18 Jul 2011 23:35:51 GMT</pubDate><guid isPermaLink="false">00000000-0000-0000-0000000013784</guid><description><![CDATA[ <p>I can not launch ASP.NET Website Administrator Tool .It shows this msg &quot;An error was encountered. Please return to the previous page and try again.&quot; in error page when click the link <a rel="nofollow" href="http://localhost:1242/asp.netwebadminfiles" target="_blank">localhost</a></p>]]></description><enclosure length="0" type="image/png" url="http://i1.asp.net/avatar/wkpham.jpg?forceidenticon=false&amp;dt=635045874000000000&amp;enableAvatar=False&amp;cdn_id=2013-05-10-001" /></item><item><title>Comment Posted by slink8</title><link>http://asp.net/mvc/tutorials/mvc-music-store/mvc-music-store-part-7</link><pubDate>Fri, 29 Jul 2011 08:42:13 GMT</pubDate><guid isPermaLink="false">00000000-0000-0000-0000000013873</guid><description><![CDATA[ <p>I had trouble also with the web site administration tool. After reading various sites and these notes I decided to look at the SQL manager and the inability to open a database led to the fact that my SQL service was not started. No idea why that was but things started flying along nicely after I started the service.</p>]]></description><enclosure length="0" type="image/png" url="http://i1.asp.net/avatar/slink8.jpg?forceidenticon=false&amp;dt=635045874000000000&amp;enableAvatar=False&amp;cdn_id=2013-05-10-001" /></item><item><title>Comment Posted by dotcomsoftware</title><link>http://asp.net/mvc/tutorials/mvc-music-store/mvc-music-store-part-7</link><pubDate>Mon, 15 Aug 2011 18:19:58 GMT</pubDate><guid isPermaLink="false">00000000-0000-0000-0000000013964</guid><description><![CDATA[ <p>Had trouble with this tutorial, because the ASP.NET Configuration tool would not connect to the database. Tried adding configuraton entries for membership, profile and role providers copied from the ASP.NET MVC 3 Web Application, but still no success. </p><p></p><p>Does the SQL Server CE database need to have membership tables added to enable security?</p>]]></description><enclosure length="0" type="image/png" url="http://i2.asp.net/avatar/dotcomsoftware.jpg?forceidenticon=false&amp;dt=635045874000000000&amp;enableAvatar=False&amp;cdn_id=2013-05-10-001" /></item><item><title>Comment Posted by dotcomsoftware</title><link>http://asp.net/mvc/tutorials/mvc-music-store/mvc-music-store-part-7</link><pubDate>Tue, 16 Aug 2011 06:20:42 GMT</pubDate><guid isPermaLink="false">00000000-0000-0000-0000000013970</guid><description><![CDATA[ <p>Resolved this problem by installing ASP.NET Universal Providers NuGet package. </p>]]></description><enclosure length="0" type="image/png" url="http://i2.asp.net/avatar/dotcomsoftware.jpg?forceidenticon=false&amp;dt=635045874000000000&amp;enableAvatar=False&amp;cdn_id=2013-05-10-001" /></item><item><title>Comment Posted by mr Eugene</title><link>http://asp.net/mvc/tutorials/mvc-music-store/mvc-music-store-part-7</link><pubDate>Sun, 21 Aug 2011 10:43:03 GMT</pubDate><guid isPermaLink="false">00000000-0000-0000-0000000014001</guid><description><![CDATA[ <p>dotcomsoftware, could you share a link on this soft?</p>]]></description><enclosure length="0" type="image/png" url="http://i1.asp.net/avatar/mr%20Eugene.jpg?forceidenticon=false&amp;dt=635045874000000000&amp;enableAvatar=False&amp;cdn_id=2013-05-10-001" /></item><item><title>Comment Posted by mr Eugene</title><link>http://asp.net/mvc/tutorials/mvc-music-store/mvc-music-store-part-7</link><pubDate>Sun, 21 Aug 2011 12:45:04 GMT</pubDate><guid isPermaLink="false">00000000-0000-0000-0000000014002</guid><description><![CDATA[ <p>I&#39;ve done like siriosus said, but still can&#39;t connect to my SQL Server :(</p>]]></description><enclosure length="0" type="image/png" url="http://i1.asp.net/avatar/mr%20Eugene.jpg?forceidenticon=false&amp;dt=635045874000000000&amp;enableAvatar=False&amp;cdn_id=2013-05-10-001" /></item><item><title>Comment Posted by juancarlos_la</title><link>http://asp.net/mvc/tutorials/mvc-music-store/mvc-music-store-part-7</link><pubDate>Mon, 19 Sep 2011 14:54:27 GMT</pubDate><guid isPermaLink="false">00000000-0000-0000-0000000014218</guid><description><![CDATA[ <p>I modified the defaultConnection in web.config:</p><p></p><p>&lt;add name=&quot;DefaultConnection&quot; connectionString=&quot;Data Source=|DataDirectory|MvcMusicStore.sdf&quot; providerName=&quot;System.Data.SqlServerCe.4.0&quot; /&gt;</p><p></p><p>And it works well!</p>]]></description><enclosure length="0" type="image/png" url="http://i2.asp.net/avatar/juancarlos_la.jpg?forceidenticon=false&amp;dt=635045874000000000&amp;enableAvatar=False&amp;cdn_id=2013-05-10-001" /></item><item><title>Comment Posted by garyseven</title><link>http://asp.net/mvc/tutorials/mvc-music-store/mvc-music-store-part-7</link><pubDate>Wed, 21 Sep 2011 10:40:42 GMT</pubDate><guid isPermaLink="false">00000000-0000-0000-0000000014234</guid><description><![CDATA[ <p>Works fine, but why not start off the tutorial to include the entire solution? Also need to make sure and make the application an internet project when creating it from the template.</p>]]></description><enclosure length="0" type="image/png" url="http://i1.asp.net/avatar/garyseven.jpg?forceidenticon=false&amp;dt=635045874000000000&amp;enableAvatar=False&amp;cdn_id=2013-05-10-001" /></item><item><title>Comment Posted by jack herr</title><link>http://asp.net/mvc/tutorials/mvc-music-store/mvc-music-store-part-7</link><pubDate>Thu, 06 Oct 2011 12:19:16 GMT</pubDate><guid isPermaLink="false">00000000-0000-0000-0000000014337</guid><description><![CDATA[ <p>Here is what I did to solve the provider connection problem (note problem asked in stackoverflow, and I will answer my own question there when time lapse allows me to do so):</p><p></p><p>First, after copying the code change the namespace and the @model [namespace].models.[class name] to the actual project name.  The code in the download is named differently.</p><p></p><p>Second, create an MVC 3 Internet Project.  Copy the parts of the web config that relate to the provider (roles, membership, etc) into the web config of the tutorial project.  Basically, these are the lines of code missing from the project web config.  Make sure that the roleManager is enabled:</p><p></p><p>&lt;roleManager enabled=&quot;true&quot;&gt;</p><p></p><p>Also, the tutorial assumes that you set the security question parm to true (it is false in auto gen code), so you may want to do that as well.</p><p></p><p>Next, try in the unaltered internet project to use the ASP.Net configuration tool (as suggested in the tutorial).  You may have to set roleManager to true in this project as well.  If you can&#39;t get it to work (either using the GUI or the aspnet_regsql utility), it is probably because you are not using SQLExpress as presumed by the auto gen code.  Change your connection string to work.  I use SQL Server 2008 R2 Dev Ed, and this connection string (very simple) worked for me:</p><p></p><p>&lt;add name=&quot;ApplicationServices&quot;</p><p>        connectionString=&quot;data source=(local);Integrated Security=SSPI;database=aspnetdb&quot;</p><p>        providerName=&quot;System.Data.SqlClient&quot; /&gt;</p><p></p><p>Then, making the connection string change in the tutorial as well if needed, try the configuration for the tutorial as it is written up.  Mine worked, and you can then proceed with the tutorial.  Note:  if you do this all without changing the namespace in the copied code, you will get an error.</p>]]></description><enclosure length="0" type="image/png" url="http://i3.asp.net/avatar/jack%20herr.jpg?forceidenticon=false&amp;dt=635045874000000000&amp;enableAvatar=False&amp;cdn_id=2013-05-10-001" /></item><item><title>Comment Posted by tuppstigentom</title><link>http://asp.net/mvc/tutorials/mvc-music-store/mvc-music-store-part-7</link><pubDate>Fri, 07 Oct 2011 09:29:57 GMT</pubDate><guid isPermaLink="false">00000000-0000-0000-0000000014354</guid><description><![CDATA[ <p>@juancarlos_la : thanks juancarlos, that did the trick.</p><p></p>]]></description><enclosure length="0" type="image/png" url="http://i3.asp.net/avatar/tuppstigentom.jpg?forceidenticon=false&amp;dt=635045874000000000&amp;enableAvatar=False&amp;cdn_id=2013-05-10-001" /></item><item><title>Comment Posted by samarmir</title><link>http://asp.net/mvc/tutorials/mvc-music-store/mvc-music-store-part-7</link><pubDate>Mon, 10 Oct 2011 12:29:20 GMT</pubDate><guid isPermaLink="false">00000000-0000-0000-0000000014378</guid><description><![CDATA[ <p>Thanks a lot for another excellent tutorial. </p><p>And thanks to the users for their help within the comment section.</p><p></p><p>Sincerely</p><p>Mohammad</p>]]></description><enclosure length="0" type="image/png" url="http://i1.asp.net/avatar/samarmir.jpg?forceidenticon=false&amp;dt=635045874000000000&amp;enableAvatar=False&amp;cdn_id=2013-05-10-001" /></item><item><title>Comment Posted by robkorv</title><link>http://asp.net/mvc/tutorials/mvc-music-store/mvc-music-store-part-7</link><pubDate>Tue, 18 Oct 2011 13:12:31 GMT</pubDate><guid isPermaLink="false">00000000-0000-0000-0000000014449</guid><description><![CDATA[ <p>Hi!</p><p></p><p>All the above didn&#39;t work for me. I just found out that you need the website to be running to get the ASP.NET Configuration website to work.</p><p></p><p>So start the application first with F5 or the green play button, then click the ASP.NET Configuration icon on the Solution Explorer.</p><p></p><p>This way I didn&#39;t need to change anything.</p>]]></description><enclosure length="0" type="image/png" url="http://i3.asp.net/avatar/robkorv.jpg?forceidenticon=false&amp;dt=635045874000000000&amp;enableAvatar=False&amp;cdn_id=2013-05-10-001" /></item><item><title>Comment Posted by robkorv</title><link>http://asp.net/mvc/tutorials/mvc-music-store/mvc-music-store-part-7</link><pubDate>Tue, 18 Oct 2011 13:37:09 GMT</pubDate><guid isPermaLink="false">00000000-0000-0000-0000000014451</guid><description><![CDATA[ <p>I have one addition to my last post.</p><p></p><p>You do need to change the stuff that is written about in the tutorial.</p><p>But I also needed to change the view-scripts for Account to get the login to work.</p><p></p><p>I changed Mvc3ToolsUpdateWeb_Default (after @model) to MvcMusicStore in</p><p>ChangePassword.cshtml</p><p>LogOn.cshtml</p><p>Register.cshtml</p><p></p>]]></description><enclosure length="0" type="image/png" url="http://i3.asp.net/avatar/robkorv.jpg?forceidenticon=false&amp;dt=635045874000000000&amp;enableAvatar=False&amp;cdn_id=2013-05-10-001" /></item><item><title>Comment Posted by alisonboss</title><link>http://asp.net/mvc/tutorials/mvc-music-store/mvc-music-store-part-7</link><pubDate>Thu, 20 Oct 2011 10:50:37 GMT</pubDate><guid isPermaLink="false">00000000-0000-0000-0000000014468</guid><description><![CDATA[ <p>starting the sqlexpress service was set to manual. I started it and it worked straight away.</p>]]></description><enclosure length="0" type="image/png" url="http://i1.asp.net/avatar/alisonboss.jpg?forceidenticon=false&amp;dt=635045874000000000&amp;enableAvatar=False&amp;cdn_id=2013-05-10-001" /></item><item><title>Comment Posted by Sam__I__am</title><link>http://asp.net/mvc/tutorials/mvc-music-store/mvc-music-store-part-7</link><pubDate>Tue, 25 Oct 2011 12:50:10 GMT</pubDate><guid isPermaLink="false">00000000-0000-0000-0000000014493</guid><description><![CDATA[ <p>Ah, Create a new application and copy the files.  Beautiful</p>]]></description><enclosure length="0" type="image/png" url="http://i1.asp.net/avatar/Sam__I__am.jpg?forceidenticon=false&amp;dt=635045874000000000&amp;enableAvatar=False&amp;cdn_id=2013-05-10-001" /></item><item><title>Comment Posted by aivars</title><link>http://asp.net/mvc/tutorials/mvc-music-store/mvc-music-store-part-7</link><pubDate>Tue, 01 Nov 2011 04:03:31 GMT</pubDate><guid isPermaLink="false">00000000-0000-0000-0000000014531</guid><description><![CDATA[ <p>Hi!</p><p>I have added Site.Master file to Account directory and now when trying to run /StoreManager  it gives me mistakes:</p><p></p><p></p><p>Source Error: </p><p></p><p>An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.</p><p></p><p>Stack Trace: </p><p></p><p></p><p>[HttpException (0x80004005): Cannot find ContentPlaceHolder &#39;MainContent&#39; in the master page &#39;/Views/Shared/Site.Master&#39;, verify content control&#39;s ContentPlaceHolderID attribute in the content page.]</p><p>   System.Web.UI.MasterPage.CreateMaster(TemplateControl owner, HttpContext context, VirtualPath masterPageFile, IDictionary contentTemplateCollection) +8959036</p><p>   System.Web.UI.Page.get_Master() +54</p><p>   System.Web.UI.Page.ApplyMasterPage() +15</p><p>   System.Web.UI.Page.PerformPreInit() +45</p><p>   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +328</p><p></p><p>can some one give some advice</p><p></p><p>Many thanks</p>]]></description><enclosure length="0" type="image/png" url="http://i3.asp.net/avatar/aivars.jpg?forceidenticon=false&amp;dt=635045874000000000&amp;enableAvatar=False&amp;cdn_id=2013-05-10-001" /></item><item><title>Comment Posted by TheGDizzo</title><link>http://asp.net/mvc/tutorials/mvc-music-store/mvc-music-store-part-7</link><pubDate>Tue, 01 Nov 2011 18:23:03 GMT</pubDate><guid isPermaLink="false">00000000-0000-0000-0000000014539</guid><description><![CDATA[ <p>Ok, after a TON of battling that occured when I attempted to implement Authentication and Roles... the followed has occurred.</p><p></p><p>There doesn&#39;t seem to be a way to have the &quot;aspnetdb&quot; that the aspnet_regsql.exe wants to create... able to be created in SQL Server Compact 4.0???</p><p></p><p>Apparently the SQL Server Compact 4.0 isn&#39;t seen as the instancename of &#39;SQLEXPRESS&#39;?</p><p></p><p>Only thing I was able to successfully enter in the aspnet_regsql.exe was my machine name of GHART-DEV which ended-up creating the aspnetdb as a database within my full-blown SQL Server 2008 R2 also running on this machine.</p><p></p><p>I tried tweaking the web.config entries related to these two so that perhaps one could just sit on my 2008 R2 server and the other the MvcMusicStore.sdf could remain as it is.  This didn&#39;t want to work.  Whenever I would try to invoke the ASP.NET Web Config. Tool site and select &#39;Security&#39;... it would invariably come back with &#39;Unable to access SQL Server&#39;.</p><p></p><p>I tried some Googled suggestion of perhaps using NuGet to grab for a cetain package which might allow ASP.NET Web Site Config tool to maybe be able to work with SqlServerCE 4.0 but this proved to make things worse.  </p><p></p><p>So I carefully performed manual &quot;surgery&quot; in the Solution Explorer to remove the packages I installed and the BS from the demo dealing with implementing Authentication and Roles.</p><p></p><p>Got myself back to the running state it was at just before this tutorial began.</p><p></p><p>On a hunch I tried the following:</p><p>changed the connectionString setups in web.config so that the MvcMusicStore and the aspnetdb would now both be saved into/read from my SQL Server 2008 R2 server.</p><p></p><p>  &lt;connectionStrings&gt;</p><p>    &lt;add name=&quot;ApplicationServices&quot;</p><p>         connectionString=&quot;Data Source=GHART-DEV;Initial Catalog=aspnetdb;Integrated Security=SSPI;&quot;</p><p>         providerName=&quot;System.Data.SqlClient&quot; /&gt;</p><p>    &lt;remove name=&quot;LocalSqlServer&quot;/&gt;</p><p>      &lt;add name=&quot;LocalSqlServer&quot;</p><p>           connectionString=&quot;Data Source=GHART-DEV;Initial Catalog=aspnetdb;Integrated Security=SSPI&quot;</p><p>           providerName=&quot;System.Data.SqlClient&quot;/&gt;</p><p>    &lt;add name=&quot;MusicStoreEntities&quot;</p><p>         connectionString=&quot;Data Source=GHART-DEV;Initial Catalog=MvcMusicStore;Integrated Security=SSPI&quot;</p><p>         providerName=&quot;System.Data.SqlClient&quot; /&gt;</p><p>  &lt;/connectionStrings&gt;</p><p></p><p>One thing I learned here was that I had to remove the &quot;User Instance=True&quot; part of the connection string otherwise ASP.NET Web Config. Tool would get an error when I attempted to invoke &#39;Security&#39; now that I had things &quot;transferred over&quot; to my SQL 2008 R2 server.</p><p></p><p>&quot;The user instance login flag is not supported on this version of SQL Server. The connection will be closed.&quot;</p><p></p><p>Removing that part of the connection string got me in. Hella-freakin-lujah!</p><p></p><p>There are now some interesting Problems I&#39;m having with StoreManagerController... (continued on next comment post)</p>]]></description><enclosure length="0" type="image/png" url="http://i2.asp.net/avatar/TheGDizzo.jpg?forceidenticon=false&amp;dt=635045874000000000&amp;enableAvatar=False&amp;cdn_id=2013-05-10-001" /></item><item><title>Comment Posted by TheGDizzo</title><link>http://asp.net/mvc/tutorials/mvc-music-store/mvc-music-store-part-7</link><pubDate>Tue, 01 Nov 2011 18:39:46 GMT</pubDate><guid isPermaLink="false">00000000-0000-0000-0000000014540</guid><description><![CDATA[ <p>side note : I also believe one of hte NuGet&#39;s I did was for EF 4.1 and this caused several annoying problems involving scope and visibility.  Apparently where a few certain classes now reside has been slightly changed (Just Lovely!) So I had to add an add&#39;l &#39;using System.Data.Entity.Database;&#39; line to SampleData.cs to prevent the Build from yelling at me about DropCreateDatabaseIfModelChanges&lt; &gt;.</p><p></p><p>In the StoreManager... </p><p></p><p>When an attempt is made to &quot;Edit&quot; an item... somehow when the form is getting HttpPost&#39;d back for the Edit, the value contained in the      @Html.HiddenFor(model =&gt; model.AlbumId) seems to NOT be getting passed-back!  This AlbumID keeps coming back as 0 even though in debugging I could clearly see the album Entity had a value of 1 debugging the Find( ) that occurs during the HTTPGET of the Edit method.  This 0 AlbumID would cause an exception that would abort the save of the edit. Desiring to move-on and learn about the Authentication and Roles tutorial I just dealt with changing that value back to a 1 in Debug in the IDE so it could continue and save back to DB.</p><p></p><p>in the Index View... the current coding seems to not be properly displaying (cutting-off) the decimal portion of the Album Price value displayed.  Instead of @Html.DisplayFor(modelItem =&gt; item.Price) I tried using @Html.DisplayTextFor(modelItem =&gt; item.Price) with no improvement.  What would be the right way to display the price so that it doesn&#39;t keep chopping-off the cents values?</p><p></p><p>And why did this change to having both connectionString&#39;s now use SQL server 2008 R2 seem to all of a sudden make that @Html.HiddenFor(model =&gt; model.AlbumId) start coming back as 0?</p>]]></description><enclosure length="0" type="image/png" url="http://i2.asp.net/avatar/TheGDizzo.jpg?forceidenticon=false&amp;dt=635045874000000000&amp;enableAvatar=False&amp;cdn_id=2013-05-10-001" /></item><item><title>Comment Posted by TheGDizzo</title><link>http://asp.net/mvc/tutorials/mvc-music-store/mvc-music-store-part-7</link><pubDate>Thu, 03 Nov 2011 13:30:55 GMT</pubDate><guid isPermaLink="false">00000000-0000-0000-0000000014553</guid><description><![CDATA[ <p>As I have now noted in the comments section of the previous tutorial. The problem with the album.AlbumId coming back as a 0 (zero) value to the HTTPPOST&#39;d Edit is/was due to the AlbumId property having the Data Annotation of &quot;Bind Exclude&quot; applied to it.</p><p></p><p>But interestingly enough... the other problem of the Album.Price field having the decimal portion of the price amount getting chopped-off apparently has something to do with SQL Server 2008 R2 itself?  Or most likely something related to how I&#39;m using it?</p><p></p><p>To test this problem I went into SSMS and made a new database and a new trimmed-down version of the Albums table which containing just Price and Title.</p><p></p><p>The 1st time I made the table I made the Price field be a decimal data type to emulate what I was dealing with in the tutorial.  Right there, raw, in Query Analyzer I did an INSERT with a price value containing a decimal portion to the number (3.33).</p><p></p><p>I opened another Query Analyzer window in SSMS and then did a SELECT query to pull this record back and it only shows the whole number value of the inserted value! (3)</p><p></p><p>For sh!ts and giggles I made another table and chose the money datatype for the price field and that version seemed to accept and retain the decimal portion of the INSERT&#39;d number just fine.  Oddly enough though... I can&#39;t seem to find a C# data type that directly correlates with this &quot;money&quot; datatype available to me in SQL Server 2008 R2.</p><p></p><p>Can anyone shed some light as to what I might be doing wrong with this decimal data type on the SQL Server side of things?</p><p></p><p>NOTE: The MvcMusicStore database which right now exists in my SQL Server was automatically generated by the Drop and Create coding in the Initializer code in SampleData.cs  so it&#39;s not even like I did anything myself to mess something up with that field definition myself.</p>]]></description><enclosure length="0" type="image/png" url="http://i2.asp.net/avatar/TheGDizzo.jpg?forceidenticon=false&amp;dt=635045874000000000&amp;enableAvatar=False&amp;cdn_id=2013-05-10-001" /></item></channel></rss>