Wrox Programmer Forums
|
BOOK: Beginning ASP.NET 4.5.1 : in C# and VB
This is the forum to discuss the Wrox book Beginning ASP.NET 4.5.1: in C# and VB by Imar Spaanjaars; ISBN: 978-1-118-84677-3
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning ASP.NET 4.5.1 : in C# and VB section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old March 12th, 2015, 07:36 AM
Authorized User
 
Join Date: Jan 2009
Posts: 32
Thanks: 4
Thanked 0 Times in 0 Posts
Default

Imar, sorry for sounding cranky. I had to get away from this for a bit to clear my head.

I took the Chapter 16 webconfig file and put that into my project, changed the settings accordingly, and run the Create User Wizard to try and get the Role tables incorporated into my database but am now getting this error:

An attempt to attach an auto-named database for file Safety_Designs.mdf failed. A database with the same name exists, or specified file cannot be opened, or it is located on UNC share.

Stack Trace:
[SqlException (0x80131904): An attempt to attach an auto-named database for file Safety_Designs.mdf failed. A database with the same name exists, or specified file cannot be opened, or it is located on UNC share.]
System.Data.SqlClient.SqlInternalConnection.OnErro r(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction) +5340655
System.Data.SqlClient.TdsParser.ThrowExceptionAndW arning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose) +244
System.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean& dataReady) +1691
System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj) +69
System.Data.SqlClient.SqlInternalConnectionTds.Com pleteLogin(Boolean enlistOK) +30
System.Data.SqlClient.SqlInternalConnectionTds.Att emptOneLogin(ServerInfo serverInfo, String newPassword, SecureString newSecurePassword, Boolean ignoreSniOpenTimeout, TimeoutTimer timeout, Boolean withFailover) +317
System.Data.SqlClient.SqlInternalConnectionTds.Log inNoFailover(ServerInfo serverInfo, String newPassword, SecureString newSecurePassword, Boolean redirectedUserInstance, SqlConnectionString connectionOptions, SqlCredential credential, TimeoutTimer timeout) +891
System.Data.SqlClient.SqlInternalConnectionTds.Ope nLoginEnlist(TimeoutTimer timeout, SqlConnectionString connectionOptions, SqlCredential credential, String newPassword, SecureString newSecurePassword, Boolean redirectedUserInstance) +307
System.Data.SqlClient.SqlInternalConnectionTds..ct or(DbConnectionPoolIdentity identity, SqlConnectionString connectionOptions, SqlCredential credential, Object providerInfo, String newPassword, SecureString newSecurePassword, Boolean redirectedUserInstance, SqlConnectionString userConnectionOptions, SessionData reconnectSessionData) +518
System.Data.SqlClient.SqlConnectionFactory.CreateC onnection(DbConnectionOptions options, DbConnectionPoolKey poolKey, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningConnection, DbConnectionOptions userOptions) +278
System.Data.ProviderBase.DbConnectionFactory.Creat ePooledConnection(DbConnectionPool pool, DbConnection owningObject, DbConnectionOptions options, DbConnectionPoolKey poolKey, DbConnectionOptions userOptions) +38
System.Data.ProviderBase.DbConnectionPool.CreateOb ject(DbConnection owningObject, DbConnectionOptions userOptions, DbConnectionInternal oldConnection) +732
System.Data.ProviderBase.DbConnectionPool.UserCrea teRequest(DbConnection owningObject, DbConnectionOptions userOptions, DbConnectionInternal oldConnection) +85
System.Data.ProviderBase.DbConnectionPool.TryGetCo nnection(DbConnection owningObject, UInt32 waitForMultipleObjectsTimeout, Boolean allowCreate, Boolean onlyOneCheckConnection, DbConnectionOptions userOptions, DbConnectionInternal& connection) +1057
System.Data.ProviderBase.DbConnectionPool.TryGetCo nnection(DbConnection owningObject, TaskCompletionSource`1 retry, DbConnectionOptions userOptions, DbConnectionInternal& connection) +78
System.Data.ProviderBase.DbConnectionFactory.TryGe tConnection(DbConnection owningConnection, TaskCompletionSource`1 retry, DbConnectionOptions userOptions, DbConnectionInternal oldConnection, DbConnectionInternal& connection) +196
System.Data.ProviderBase.DbConnectionInternal.TryO penConnectionInternal(DbConnection outerConnection, DbConnectionFactory connectionFactory, TaskCompletionSource`1 retry, DbConnectionOptions userOptions) +146
System.Data.ProviderBase.DbConnectionClosed.TryOpe nConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory, TaskCompletionSource`1 retry, DbConnectionOptions userOptions) +16
System.Data.SqlClient.SqlConnection.TryOpenInner(T askCompletionSource`1 retry) +94
System.Data.SqlClient.SqlConnection.TryOpen(TaskCo mpletionSource`1 retry) +110
System.Data.SqlClient.SqlConnection.Open() +96
System.Data.Common.DbDataAdapter.FillInternal(Data Set dataset, DataTable[] datatables, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior) +121
System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior) +316
System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, String srcTable) +86
System.Web.UI.WebControls.SqlDataSourceView.Execut eSelect(DataSourceSelectArguments arguments) +1474
System.Web.UI.WebControls.ListControl.OnDataBindin g(EventArgs e) +101
System.Web.UI.WebControls.ListControl.PerformSelec t() +34
System.Web.UI.WebControls.BaseDataBoundControl.Dat aBind() +30
System.Web.UI.WebControls.BaseDataBoundControl.Ens ureDataBound() +105
System.Web.UI.WebControls.ListControl.OnPreRender( EventArgs e) +23
System.Web.UI.Control.PreRenderRecursiveInternal() +83
System.Web.UI.Control.PreRenderRecursiveInternal() +155
System.Web.UI.Control.PreRenderRecursiveInternal() +155
System.Web.UI.Control.PreRenderRecursiveInternal() +155
System.Web.UI.Control.PreRenderRecursiveInternal() +155
System.Web.UI.Control.PreRenderRecursiveInternal() +155
System.Web.UI.Control.PreRenderRecursiveInternal() +155
System.Web.UI.Control.PreRenderRecursiveInternal() +155
System.Web.UI.Control.PreRenderRecursiveInternal() +155
System.Web.UI.Control.PreRenderRecursiveInternal() +155
System.Web.UI.Control.PreRenderRecursiveInternal() +155
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +974
 
Old March 20th, 2015, 11:16 AM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Sorry for the late reply; I was traveling the last two weeks.

Try looking at this post and Google result and follow some of the links:

Problem using SQL Server Express 2008

https://www.google.nl/?gfe_rd=cr&ei=...UNC+share.+%22

The error you're getting is probably related to an issue with SQL Server and you may need to delete a folder before it can works.

Cheers,

Imar
__________________
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Follow me on Twitter

Author of Beginning ASP.NET 4.5 : in C# and VB, Beginning ASP.NET Web Pages with WebMatrix
and Beginning ASP.NET 4 : in C# and VB.
Did this post help you? Click the button below this post to show your appreciation!
 
Old April 2nd, 2015, 01:44 AM
Authorized User
 
Join Date: Jan 2009
Posts: 32
Thanks: 4
Thanked 0 Times in 0 Posts
Default

OK, thanks, I will give that a try. Hopefully that thread will help resolve it. Those posts are all pretty old and my system files are different (W8), but I think I might be able to sort it out.
 
Old April 2nd, 2015, 09:20 PM
Authorized User
 
Join Date: Jan 2009
Posts: 32
Thanks: 4
Thanked 0 Times in 0 Posts
Default

This is just happening when I'm using the "CreateNewUser" wizard to incorporate the membership tables into my database (as described in page 587 on my Kindle version of the book).

It worked the first time and then I deleted the membership tables for some stupid reason that I thoroughly regret now.

So I have two questions before I resign myself to the reality that I have to start over. 1) Is there a way to manually incorporate these membership tables into my database?; and 2) Is there a way to make it work with the membership tables as a separate database?

If I understand correctly, these ASP.NET membership tables aren't even used when a web app is deployed, so having them incorporated into the database is simply a matter of convenience but not at all necessary?

I've tried many, many "solutions" that have been mentioned around the web, including deleting the SQLEXPRESS folder, setting user instance to "false" in web.config, endlessly messing around with permissions, registering with another username, etc.

It just seems hopeless at this point.

Last edited by Psyclist; April 2nd, 2015 at 10:46 PM..
 
Old April 4th, 2015, 04:24 AM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Hi there,

Sorry for the slow response. I was out traveling.

When you deleted all the tables, did you also delete the table __MigrationHistory? If not, ty deleting it and see if it helps. This is how EF and the membership providers keep track of the tables and other objects that have been created.

>> If I understand correctly, these ASP.NET membership tables aren't even used when a web app is deployed

That's not correct. They are used to store your users and other data.

>> so having them incorporated into the database is simply a matter of convenience but not at all necessary?

You can store them in the same database, or you can store them in a separate database if you prefer. The latter should be as simple as specifying a different server and/or database in the connection string used by the provider (that is, the one that connectionStringName attribute for the provider configuration points to).

Also, have you tried running this against Local DB (that is, use Data Source=(LocalDB)\v11.0; instead of Data Source=.\SqlExpress)

Finally, can you delete (or move) your entire database to let it create a new one? Or do you already have other data in it?

Hope this helps, but let me know if it doesn't.

Cheers,

Imar
__________________
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Follow me on Twitter

Author of Beginning ASP.NET 4.5 : in C# and VB, Beginning ASP.NET Web Pages with WebMatrix
and Beginning ASP.NET 4 : in C# and VB.
Did this post help you? Click the button below this post to show your appreciation!





Similar Threads
Thread Thread Starter Forum Replies Last Post
Where is the Website Administration Tool? Aubreylc BOOK: Beginning ASP.NET 4.5 : in C# and VB 9 February 13th, 2014 06:36 PM
Cannot run website administration tool flashmanTom ASP.NET 2.0 Professional 9 November 12th, 2010 03:20 PM
ERROR using ASP.net Web Site Administration Tool erictamlam ASP.NET 2.0 Basics 0 April 5th, 2007 02:52 AM
ERROR using ASP.net Web Site Administration Tool erictamlam C# 2005 0 April 3rd, 2007 01:28 AM
Help! Website Administration Tool Problem agf2309 ASP.NET 2.0 Basics 2 August 29th, 2006 07:25 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.