|
|
 |
BOOK: ASP.NET 2.0 Instant Results ISBN: 978-0-471-74951-6
 | This is the forum to discuss the Wrox book ASP.NET 2.0 Instant Results by Imar Spaanjaars, Paul Wilton, Shawn Livermore; ISBN: 9780471749516 |
|
Welcome to the p2p.wrox.com Forums.
You are currently viewing the BOOK: ASP.NET 2.0 Instant Results ISBN: 978-0-471-74951-6 section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of computer programmers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other programmers’ questions, win occasional prizes given to our best members, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
|
 |
|
|
 |

May 21st, 2008, 06:55 PM
|
|
Registered User
|
|
Join Date: May 2008
Location: , , .
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Change Database Name for BugBase
Hi,
I am enjoying reading the instant results book, and will use the book as a handy-reference for my projects.
Is there a way to change the name of BugBase database (BugBase.mdf) used in Ch. 12 of the book?
I changed the name of the .mdf file in the Solution Explorer and also reflected the change in the web.config file. However, the application doesn't look working correctly.
At the end, I somehow ended up with two mdf files in the App_data folder: one with the new name, and the other with BugBase.mdf.
Can please somebody guide me to go through this?
Thank you.
|

May 22nd, 2008, 11:23 AM
|
|
Registered User
|
|
Join Date: May 2008
Location: , , .
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
I'm getting this error when I click 'Application' under 'Maintenance'.
Server Error in '/AAP' Application.
--------------------------------------------------------------------------------
Could not find stored procedure 'sprocApplicationSelectList'.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.Data.SqlClient.SqlException: Could not find stored procedure 'sprocApplicationSelectList'.
Source Error:
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.
Stack Trace:
[SqlException (0x80131904): Could not find stored procedure 'sprocApplicationSelectList'.]
System.Data.SqlClient.SqlConnection.OnError(SqlExc eption exception, Boolean breakConnection) +925466
System.Data.SqlClient.SqlInternalConnection.OnErro r(SqlException exception, Boolean breakConnection) +800118
System.Data.SqlClient.TdsParser.ThrowExceptionAndW arning(TdsParserStateObject stateObj) +186
System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj) +1932
System.Data.SqlClient.SqlDataReader.ConsumeMetaDat a() +31
System.Data.SqlClient.SqlDataReader.get_MetaData() +62
System.Data.SqlClient.SqlCommand.FinishExecuteRead er(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString) +297
System.Data.SqlClient.SqlCommand.RunExecuteReaderT ds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async) +1005
System.Data.SqlClient.SqlCommand.RunExecuteReader( CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, DbAsyncResult result) +132
System.Data.SqlClient.SqlCommand.RunExecuteReader( CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method) +32
System.Data.SqlClient.SqlCommand.ExecuteReader(Com mandBehavior behavior, String method) +122
System.Data.SqlClient.SqlCommand.ExecuteDbDataRead er(CommandBehavior behavior) +12
System.Data.Common.DbCommand.System.Data.IDbComman d.ExecuteReader(CommandBehavior behavior) +7
System.Data.Common.DbDataAdapter.FillInternal(Data Set dataset, DataTable[] datatables, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior) +141
System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior) +137
System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, String srcTable) +83
System.Web.UI.WebControls.SqlDataSourceView.Execut eSelect(DataSourceSelectArguments arguments) +1770
System.Web.UI.DataSourceView.Select(DataSourceSele ctArguments arguments, DataSourceViewSelectCallback callback) +17
System.Web.UI.WebControls.DataBoundControl.Perform Select() +149
System.Web.UI.WebControls.BaseDataBoundControl.Dat aBind() +70
System.Web.UI.WebControls.GridView.DataBind() +4
System.Web.UI.WebControls.BaseDataBoundControl.Ens ureDataBound() +82
System.Web.UI.WebControls.CompositeDataBoundContro l.CreateChildControls() +69
System.Web.UI.Control.EnsureChildControls() +87
System.Web.UI.Control.PreRenderRecursiveInternal() +50
System.Web.UI.Control.PreRenderRecursiveInternal() +170
System.Web.UI.Control.PreRenderRecursiveInternal() +170
System.Web.UI.Control.PreRenderRecursiveInternal() +170
System.Web.UI.Control.PreRenderRecursiveInternal() +170
System.Web.UI.Control.PreRenderRecursiveInternal() +170
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +2041
--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:2.0.50727.1433; ASP.NET Version:2.0.50727.1433
*********
*********
As I described in the initial posting, I am now having 2 databases: the re-named one and the BugBase. When I looked at the stored procedures under each database, only BugBase has the missing stored procedures.
Again, my goal is to end up with one database whose name is NOT BugBase, but with ASP.NET memebership features and BugBase objects with it.
Thanks.
|

May 22nd, 2008, 11:38 AM
|
 |
Wrox Author
Points: 36,309, Level: 83 |
|
|
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 10,696
Thanks: 13
Thanked 303 Times in 299 Posts
|
|
Quote:
|
quote:When I looked at the stored procedures under each database, only BugBase has the missing stored procedures.
|
That seems to indicate the web app picked up the right database, but it's not a valid copy somehow?
Renaming doesn't seem enough. Internally the database keeps track of the name as well. You can rename the files as follows:
1. Open the database using Microsoft SQL Server Management Studio
2. Open its Properties
3. Switch to the Files category
4. Change the Logical name to your new name.
Following this procedure I could make it work.
Alternatively, script the objects in the existing BugBase database and recreate them in the new one:
http://Imar.Spaanjaars.Com/Downloads...erver_2005.zip
Cheers,
Imar
---------------------------------------
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Everyone is unique, except for me.
Author of Beginning ASP.NET 3.5 : in C# and VB, ASP.NET 2.0 Instant Results and Dreamweaver MX 2004
Want to be my colleague? Then check out this post.
|

May 22nd, 2008, 12:50 PM
|
|
Registered User
|
|
Join Date: May 2008
Location: , , .
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Imar,
thanks much for the INSTANT reply and detailed instruction.
I will follow the steps you described and let you know what I will experience.
Have a good one.
|

May 22nd, 2008, 03:25 PM
|
|
Registered User
|
|
Join Date: May 2008
Location: , , .
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Hi Imar,
I took both approaches you described.
Using the first approach (changing the logical name), it worked. However, the physical name of the database (BugBase.mdf) stayed the same although the logical name changed. Is there a way to change both physical and logical names? I apologize for my lack of knowledge in SQL Server...
Regarding the alternative approach, I created a new database, and ran the sql script you provided. Then, I applied the asp.net membership-related Schema to the new database (I used the steps in http://aspnet.4guysfromrolla.com/articles/040506-1.aspx). Then, after modifying the web.config, I was able to run the BugBase application using the new database.
Thank you very much for guiding me through this. I was inspired by your chapters on the book as well as by the excellent articles on the n-tier design on your web site. I will use your design model and coding tips for my current and future projects.
Regards,
|

May 22nd, 2008, 04:16 PM
|
 |
Wrox Author
Points: 36,309, Level: 83 |
|
|
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 10,696
Thanks: 13
Thanked 303 Times in 299 Posts
|
|
Hi there,
You're welcome; glad things are working now and good to hear you like my work.
The physical file can be renamed using Windows Explorer or the Solution Explorer like you tried earlier. The physical name is just the Windows file name (BugBase.mdf) while the logical name is SQL Server's way of keeping track of databases that consist of multiple files.
You need to rename both in order to rename the database. Or, as you found out, just create a brand new database.
Cheers,
Imar
---------------------------------------
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Everyone is unique, except for me.
Author of Beginning ASP.NET 3.5 : in C# and VB, ASP.NET 2.0 Instant Results and Dreamweaver MX 2004
Want to be my colleague? Then check out this post.
|

May 23rd, 2008, 11:19 AM
|
|
Registered User
|
|
Join Date: May 2008
Location: , , .
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Thank you very much for the follow-up and additional information.
|
| Thread Tools |
Search this Thread |
|
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|
 |