 |
BOOK: Beginning ASP.NET 2.0 BOOK VB ISBN: 978-0-7645-8850-1; C# ISBN: 978-0-470-04258-8  | This is the forum to discuss the Wrox book Beginning ASP.NET 2.0 by Chris Hart, John Kauffman, David Sussman, Chris Ullman; ISBN: 9780764588501 |
|
Welcome to the p2p.wrox.com Forums.
You are currently viewing the BOOK: Beginning ASP.NET 2.0 BOOK VB ISBN: 978-0-7645-8850-1; C# ISBN: 978-0-470-04258-8 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
|
|
|
|
|

August 31st, 2006, 02:28 PM
|
|
Registered User
|
|
Join Date: Aug 2006
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Error with CH. 10 ObjectDataSource Control in C#
I've seen two posts already on this error, but no responses on how to correct the problem
Once I have completed the "Try it out" section (adding a ObjectDataSource and GridView), I open my browser to the default page and receive this error:
Server Error in '/Wrox' Application.
--------------------------------------------------------------------------------
CREATE DATABASE permission denied in database 'master'.
An attempt to attach an auto-named database for file C:\BegASPNET2\Begin\Chapter10\ObjectDataSource\App _Data\WroxUnited.mdf failed. A database with the same name exists, or specified file cannot be opened, or it is located on UNC share.
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: CREATE DATABASE permission denied in database 'master'.
An attempt to attach an auto-named database for file C:\BegASPNET2\Begin\Chapter10\ObjectDataSource\App _Data\WroxUnited.mdf failed. A database with the same name exists, or specified file cannot be opened, or it is located on UNC share.
Source Error:
Line 783: this.Adapter.SelectCommand = this.CommandCollection[0];
Line 784: osd.PlayersDataTable dataTable = new osd.PlayersDataTable();
Line 785: this.Adapter.Fill(dataTable);
Line 786: return dataTable;
Line 787: }
Source File: c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temp orary ASP.NET Files\wrox\6595bd89\1c926d70\App_Code.yawm7sb0.0.c s Line: 785
I'm using SQL Server 2005 Express. Does anyone know how I can fix this error?
|
|

August 31st, 2006, 05:22 PM
|
|
Authorized User
|
|
Join Date: Jan 2006
Posts: 41
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
I didn't have a problem with that particular Try It Out, but I got that same "An attempt to attach an auto-named database..." error message in the Try It Out that starts on page 375. The reason for the error was that the path to the database in the connection string inside Web.Config was incorrect.
So one thing to do is make sure there's actually a database in C:\BegASPNET2\Begin\Chapter10\ObjectDataSource\App _Data\.
|
|

September 1st, 2006, 11:48 AM
|
|
Registered User
|
|
Join Date: Aug 2006
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
The path is correct. I saw your post about the path in webconfig, but there is a database located at that path. I am somewhat curious about the line in the error that reads "CREATE DATABASE permission denied in database 'master'". Is there some type of permission that needs to be added to SQL server express? Any help anyone can give me will be greatly appreciated.
|
|

October 7th, 2006, 03:55 PM
|
|
Registered User
|
|
Join Date: Oct 2006
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
I had this problem running in Vista, so I suspect it's caused by the permission given to the local user when running Cassini, when I tried running the exercises in IIS, I received no error.
|
|

October 13th, 2006, 09:37 AM
|
|
Friend of Wrox
|
|
Join Date: Jun 2003
Posts: 105
Thanks: 0
Thanked 1 Time in 1 Post
|
|
dramsey,
I think that the simplest way to sort this out is to add another step prior to Step 2 of the try it out on page 359 and that's to open web.config and delete the connection strings defined there already. Then in step 6, create a new connection to the wroxunited.mdf file in the ObjectDataSource\app_Data folder of your project.
That should solve it.
FWIW, I think the connection string in web.config there in the download is mispelt. It says AttachDbFilename=|DataDirectory|WroxUnited.mdf rather than AttachDbFilename=|DataDirectory|\WroxUnited.mdf
Dan
Dan Maharry
Read the feed at http://feeds.feedburner.com/dansarchive
|
|

January 15th, 2007, 02:52 PM
|
|
Registered User
|
|
Join Date: Jan 2007
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Mr. Dramsey,
I'm still looking for the answer of the problem faced by you. Have it been solved ? If so , please guide me .
I'm confused as http://forums.microsoft.com/MSDN/Sho...37473&SiteID=1 link says something which is hard to be understood by me.
Pl. guide/Help.
Thanks
|
|

January 15th, 2007, 03:01 PM
|
|
Registered User
|
|
Join Date: Jan 2007
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
By the way , all of you are requested to Help guide me on the following problem ;
Up on selecting web site -> web site configuration OR trying to run the application CASSini I'm getting the error as " Unable to load the current version of the run time to run this application" . Then after I'm getting the error as " Unable to contact Visual Studio's Localhost server".
This is forced me to use another web server other than Cassini.
Pl. help/guide
|
|

February 14th, 2007, 11:09 PM
|
|
Registered User
|
|
Join Date: Feb 2007
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
I ran into the same issue as I was going through the examples in Chapter 10. I found the answer in the following link:
http://forums.asp.net/thread/903667.aspx
Within the web.config file, I changed the connectionstring to the following:
connectionString="Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirector y|\WroxUnited.mdf;Integrated Security=True;User Instance=True"
The page will now render in debug mode without errors. Hope this helps.
MIKE
|
|
 |