Jeremy Wadsworth
My Contribution to the ASP.NET Community


Welcome   
Welcome to my personal website. Here you will find blog posts related to web development as well as personal related interests. If you're here for the source code to my Personal Web Site Kit, please register and you'll receive an email when your account has been approved.


Latest Blog Entries

 Thursday, August 14, 2008


Attach database failed for Server computername\SQLEXPRESS    

The error I received.

Attach database failed for Server 'COMPUTERNAME\SQLEXPRESS'.  (Microsoft.SqlServer.Smo)
------------------------------
ADDITIONAL INFORMATION:

An exception occurred while executing a Transact-SQL statement or batch. (Microsoft.SqlServer.ConnectionInfo)
Directory lookup for the file "C:\Data\WebHelp\help_log.ldf" failed with the operating system error 2 (The system cannot find the file specified.). (Microsoft SQL Server, Error: 5133)

This error occurred for me when I tried to attach and SQL Server was looking for an existing log file (.ldf). I was able to get around this by doing the following.

Opened up SQL Server Management Studio Express. Browsed to my database (.mdf) file. Once I set the file name to attach I selected the log file that was listed below the database file, and clicked the Remove button located just above the Cancel button.



jeremy at 11:32 PM | (25) Comments | Add a comment | Permalink





Commments
kavicarter said...

Jeremy, Great work. Your site is very informative and helpful. I have a question about your UserManagment demo. I am using the standard aspnetdb.mdf and have implemented a login system using the createwizard controls and login controls and a profile system through the web.config. Is there a way for an admin (like in your demo) to be able to edit a user's profile data so that when they log on to their profile page they can see changes the administrator made? Or is this not possible because of the security implemented by a standard aspnetdb? Thank you so much. Email: kmj6@lehigh.edu

Tuesday, August 19, 2008 6:38 PM

Rafael Rodriguez said...

how do i change the database connection for SQL 2005? I uncommented the SQL2005 on web.config but the site gives me errors.

Monday, October 27, 2008 1:25 PM

deepak said...

how do i change the database connection for SQL 2005 for an IP address connection ?

Monday, December 08, 2008 4:26 AM

jeremy said...

<add name="SiteSqlServer" connectionString="Server=serverORIP;user id=myusername;password=mypassword;database=DBName" providerName="System.Data.SqlClient"/>

Saturday, December 20, 2008 11:23 AM

IanB said...

Hi I have got the default PWSK from asp.net working, and have now replaced it with your latest version. I get a error on line 196 in SiteSettingsManager.vb but it works fine localy. Any clues to where I've gone wrong would be great.

Thursday, April 23, 2009 7:00 AM

jeremy said...

I admit, there are some design flaws in the site. One of them is that the site_settings table cannot be empty by default and must have only one record with the ID of 1. I'll email you a script.

Friday, April 24, 2009 3:04 PM

Sue said...

I removed the log file as you suggested, but still cannot get my .mdf file to attach...have been struggling with this for several hours now...have successfully attached both adventureworksDW2008 & Northwind - only the adventureworks2008 fails to attach...any help would be much appreciated

Sunday, June 07, 2009 2:54 PM

jeremy said...

I'm not sure. If you copied the MDF from somewhere without detaching it first, you may run into problems not being able to attach it.

Sunday, June 07, 2009 9:14 PM

hearing aid said...

Hi I have got the default PWSK from asp.net working, and have now replaced it with your latest version. I get a error on line 196 in SiteSettingsManager.vb but it works fine localy. Any clues to where I've gone wrong would be great.

Wednesday, November 25, 2009 12:57 AM

jeremy said...

Regarding the error on line 196, there needs to be a record in the site_Settings table with a SiteID of 1.

Sunday, November 29, 2009 11:13 PM

jeremy said...

Regarding tracking of administrator changes to user profiles, anything is possible.

Sunday, November 29, 2009 11:28 PM

Schoenhut Elite Baby Grand Piano said...

the web.config. Is there a way for an admin (like in your demo) to be able to edit a user's profile data so that when they log on to their profile page they can see changes the administrator made? Or is this not possible because of the security implemented by a standard aspnetdb? Thank you so much. Email: kmj6@lehigh.edu

Wednesday, February 10, 2010 10:05 AM

jeremy said...

Certainly an administrator could make changes to any profile, but for the user to then see what changed next time they log in, you would likely need another table to store a snapshot of the data before you changed it. Then you could pull from the asp_profile table and your snapshot table, to show differences to the logged in user.

Monday, February 15, 2010 8:43 AM

shalick said...

Much appreciated. I have been fighting with this issue for a while now.

Tuesday, February 23, 2010 11:02 AM

Search Engine Optimization said...

This is a discussion on Attach database failed sqlserver-faq Hi I have a C# application which creates and populates a SQL Server Express database. I then copy the database and log files and move it to a different directory where I would like to use SQL Server Management Studio.......... http://www.topseotech.com

Thursday, May 13, 2010 4:29 AM

Agile Informatics said...

I have a fresh install of SQL Server on my local machine, which is probably the source of my angst, but I am trying to create a database from scratch through using a batch file that is run from the command line, the batch file looks like this:

Friday, July 16, 2010 1:43 AM

Best Bingo Games said...

the problems is that sql server 2008 made the instance name of computer-name\SQLEXPRESS and I don't know how to remove it. I couldn't successfully uninstall sql server 2008 express completely so I deleted program file directories. I still can't get rid of sql server 2008's instance name so I can reinstall sql server 2005 with that instance name.

Friday, July 16, 2010 6:10 AM

Tiffany jewellery said...

but I am trying to create a database from scratch through using a batch file that is run from the command line, the batch file looks like this

Friday, July 16, 2010 9:09 PM

offshore company said...

Is there a way for an admin (like in your demo) to be able to edit a user's profile data so that when they log on to their profile page they can see changes the administrator made?

Saturday, July 17, 2010 6:04 PM

Search Engine Optimisation UK said...

you changed it. Then you could pull from the asp_profile table and your snapshot table, to show differences to the logged in user.

Sunday, July 18, 2010 7:22 AM

TrainPro School said...

Everybody knows the bitter, bloody battle that took place on Omaha Beach 66 years ago. Omaha was crucial to the success of our invasion of Adolf Hitler’s “fortress Europe.” Our casualties were heavy, and for long hours the outcome of the battle was in grave doubt.

Tuesday, July 27, 2010 8:36 AM

srikanth said...

If i change DB connectionString of wcf application will it work.?

Tuesday, August 17, 2010 10:20 AM

mbt shoes clearance said...

This website is organic! Most on the time when i stop by weblogs, I engage into intense advertisements that give me nothing, but this time when I came accross into your site and I used to be stunned. You are giving out some skilled info. Please preserve it up!

Thursday, August 19, 2010 4:32 AM

wholesale nfl jerseys said...

Hey guys, I hope this allowed, I have never used this website before so I wasn't really sure what this was going to do. <a href="http://www.nfljerseyse.com" title="wholesale nfl jerseys">wholesale nfl jerseys</a> So this is just a test post. I really like this forum, it has some excellent discussions that take place.

Wednesday, September 01, 2010 11:47 PM

Kamagra said...

Please write also

Monday, September 06, 2010 10:20 AM

  Leave a comment

Enter Your Name:
 
Enter your website
Security code from image below:  
Need Custom Controls Work or Training?
   


Join WebHost4Life.com






If you would like to help support this project, please click the button below to make a small donation.