|
-
May 9th, 2013, 11:38 PM
#1
Thread Starter
Addicted Member
Cannot attach Database..
I have designed the database in SQL Server Compact and when i try to run the application it showing the following
Code:
Cannot attach the file 'D:\Webs\Login Page\Login Page\App_Data\UserMaintenance.mdf' as database 'UserMaintenance'.
Please help me someone...
-
May 10th, 2013, 12:30 AM
#2
Re: Cannot attach Database..
Do you actually mean SQL Server Express? SQL Server CE uses SDF files and doesn't use a server while SQL Server Express uses MDF files (just like the grown-up SQL Server) and does use a server.
-
May 10th, 2013, 12:32 AM
#3
Re: Cannot attach Database..
Assuming that it is SQL Server Express, if you connect to that instance in Management Studio, do you see an already attached database named "UserMaintenance"?
-
May 10th, 2013, 01:57 AM
#4
Thread Starter
Addicted Member
Re: Cannot attach Database..
its the compact database which is coming along VS2012
-
May 10th, 2013, 02:11 AM
#5
Re: Cannot attach Database..
I assume that you added the database directly to your project. Did you select a Local Database or a Service-based Database?
-
May 10th, 2013, 04:19 AM
#6
Thread Starter
Addicted Member
Re: Cannot attach Database..
-
May 10th, 2013, 04:37 AM
#7
Re: Cannot attach Database..
Then something is really wrong. The Local Database option is for SQL Server CE while the Service-based Database option is for SQL Server Express. As I said, SQL Server CE uses SDF files and no server so the fact that the error message mentions an MDF file and attaching to a server means that you are not doing what you intended to. I think you need to start again.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|