Hi,
I recently installed VS Web Developer Express Ediition and SQL Server Express and I'm doing the How To tutorials and I can't finish the basic data access walkthrough:
http://msdn2.microsoft.com/en-US/library/tw738475.aspx
Because I get an error like this (link for complete error below):
An attempt to attach an auto-named database for file C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Data\test.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: An attempt to attach an auto-named database for file C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Data\test.mdf failed. A database with the same name exists, or specified file cannot be opened, or it is located on UNC share.
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.
http://pastecode.com/6196
When I am setting up the data source for the gridview tool, everything works fine and the test query works fine, but then when I try to actually test the output in the browser with Cntrl+F5 I get this error.
I have been trying for 48 hours to find a solution on my own. I have googled, I have searched everything and I just am at a point where I think I need to ask someone for help.
Please help.
Hi,I guess you want to attach a user instance to SQL Server. But the path specified for the user instance is a server attached instance, which makes you able to view the data through the server explorer but won′t make you able to use the run the code, because at startup VS will try to create a user instance at the location specified (which is already occupied by the server instance database) and which will fail. The solution is to specify another folder to create the suer attached instance during the build of the code, thats all. That should make you able to run the build process as well as the code.
HTH, Jens K. Suessmeyer.
http://www.sqlserver2005.de|||
Try this in the config file ...
Data Source=.\SQLEXPRESS;AttachDBFilename=C:\...\db.mdf;User Instance=true
No comments:
Post a Comment