Asp Net Webparts Sqlexpress Database File Auto Creation Error
ASP.NET Community Standup Forums Help Home/ASP.NET Forums/General ASP.NET/Web Forms/SQLExpress database file auto-creation error: Web Parts SQLExpress database file auto-creation error: Web Parts [Answered]RSS 4 replies Last post Mar 25, 2009 12:30 PM by vkokaev ‹ Previous Thread|Next Thread › Print Share Twitter Facebook Email Shortcuts Active Threads Unanswered Threads Unresolved Threads Support Options Advanced Search Related Links GuidanceSamplesVideos Reply krishnada25 Member 218 Points 941 Posts SQLExpress database file auto-creation error: Web Parts Oct 15, 2008 09:46 PM|krishnada25|LINK Hi All, This is my first time creating a web part . Here is the code Below.
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up Getting “SQLExpress database file auto-creation error” for ASP.NET site that uses AspNetSqlMembershipProvider, but connection string is to SQL Server 2005 up vote http://forums.asp.net/t/1334612.aspx?SQLExpress+database+file+auto+creation+error+Web+Parts+ 5 down vote favorite Folks, I have an ASP.NET v2.0 website (not web application) where the root directory is public, but the "Admin" subdirectory requires authentication. Everything about the setup is very generic - I used a connection string defined in the root web.config, and the standard AspNetSqlMembershipProvider provider, and I'm using the ASP.NET Login control. The web.config in the Admin directory specifies that the user must have the "Admin" role. I'm using SQL http://stackoverflow.com/questions/1402430/getting-sqlexpress-database-file-auto-creation-error-for-asp-net-site-that-use Server 2008, and my connection string is good; every root level page is data driven and they all work fine. And the provider configuration seems good: when I log in, the Login control's "OnLoggedIn" event fires. The last line in that event code redirects me down to my Admin/Default.aspx page. My breakpoint in "OnLoggedIn" shows me that all's well until the redirect down into my Admin directory...and then... ...and then I wait...and wait... And then I get an error telling me it's experienced a "SQLExpress database file auto-creation error." Why in the world is it suddenly trying to create a SQL Server Express file? Why is it suddenly ignoring my connection string? One odd clue: Just before the last line of the "OnLoggedIn" event I put in this: bool blnTest = User.IsInRole("Admin"); I wanted to see if blnTest = true. What happens is the process hits this line...and waits...and eventually tells me it can't access the SQL Server Express database. It seems that any reference (either in my code, or behind the scenes) to determine the User's Role, calls the wrong database. Thoughts? EDIT: Argh, sometimes it waits when I test blnTest. Other times it immediately reports the value as "false." asp.net sql-server sql-server-express provider share|improve this question edited Sep 9 '09 at 22:49 asked Sep 9 '09 at 22:1
(Русский)ישראל (עברית)المملكة العربية السعودية (العربية)ไทย (ไทย)대한민국 (한국어)中华人民共和国 (中文)台灣 (中文)日本 (日本語) HomeLibraryLearnDownloadsTroubleshootingCommunityForums Ask a question Quick access Forums home Browse forums users FAQ Search related threads Remove From My Forums Answered by: SQL Express database file auto-creation error but web-config https://social.msdn.microsoft.com/Forums/sqlserver/en-US/3bb8fdd0-e559-44bc-9ec8-47b27047fdf7/sql-express-database-file-autocreation-error-but-webconfig-changed-to-azure-sqlserver?forum=sqldatabaseengine changed to Azure SQL-server SQL Server > SQL Server Database Engine Question 0 Sign in to vote I have an app that is based on the new MVC4 template with SImple Membership provider. I've deployed the app to an Azure website and changed the connection string from a local express-database to an Azure SQL database. I use my Google asp net Account to log on and It works perfect for a while. If I leave the browser on a page and come back later the Membership Provider somhow want's to create an express database even though in my web.config I'm pointing to the Azure SQL database which works fine if I log out and logon again. Is there a setting asp net webparts or something or is it just not ment to be used with other databases than local sql express? Thanks in advance! /TomasTomas Ekenman www.luxuryspa.se Friday, October 12, 2012 2:44 PM Reply | Quote Answers 0 Sign in to vote I finally found a solution:http://stackoverflow.com/questions/13030074/why-initializesimplemembershipattribute-in-mvc-4-app Put the MembershipproviderFilter on each controller or move it to appstart.Tomas Ekenman www.luxuryspa.se Marked as answer by ekenman Tuesday, March 19, 2013 5:21 AM Friday, March 15, 2013 5:34 AM Reply | Quote All replies 0 Sign in to vote Hi ekenman, Thank you for your question. I am trying to involve someone more familiar with this topic for a further look at this issue. Sometime delay might be expected from the job transferring. Your patience is greatly appreciated. Thank you for your understanding and support. MaggiePlease remember to mark the replies as answers if they help and unmark them if they provide no help. This can be beneficial to other community members reading the thread. Tuesday, October 16, 2012 2:56 AM Reply | Quote Moderator 0 Sign in to vote