尝试为文件****附加自动命名的数据库失败 [英] An attempt to attach an auto-named database for file **** failed

查看:227
本文介绍了尝试为文件****附加自动命名的数据库失败的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在VS2008的解决方案的app_data文件夹中添加了新的数据库文件.

但是,当我尝试从SERVER EXPLORER扩展它时,出现此错误

尝试为文件___附加自动命名的数据库失败.

查找在vs2008 IDE中发生的错误的屏幕截图.

http://www.eggheadcafe.com/FileUpload/1619491694/Errordb.jpg [ ^ ]

到底是什么问题?
以及如何解决此问题

I added new database file in my solution''s app_data folder in VS2008.

But when i tried to expand it from SERVER EXPLORER, i get this error

An attempt to attach an auto-named database for file ___ failed.

Find the screen shot of the error which occured in vs2008 IDE.

http://www.eggheadcafe.com/FileUpload/1619491694/Errordb.jpg[^]

What exactly the issue is?
And how to solve this

推荐答案

将数据库文件保留在部署文件夹中.
否则
在您的连接字符串中,只需添加"database =<数据库名称=">".这样可以防止SQL Server创建自动命名的数据库.
Keep the database file in deployment folder.
or else
In you connection string just add the ''database=<database name="">''. This prevents SQL server to create the auto-named database.


这篇关于尝试为文件****附加自动命名的数据库失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆