附加基于服务的数据库时如何解决错误 [英] how to solve error while attaching service based database

查看:83
本文介绍了附加基于服务的数据库时如何解决错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

hey friends i got error while attching service based database to my windows application as well as when i trying to attach local database it attached succsessfully but sql connection closes when i build project. i really dont know how to solve this issue. i did go through all possible solutions on web but not worked , suggest me any possible way.

here is the error sentence-

""connections to sqlserver database files(.mdf) require sql server 2005 or 2008 installed in your pc""

推荐答案

附加.mdf数据库文件是仅支持SQL Server Express 的功能。您需要安装Express版本或从SQL Server Management Studio中附加它以使其成为常规数据库实例。我推荐后者因为(来自MSDN):



此功能将在未来版本的Microsoft SQL Server中删除。请避免在以下版本中使用此功能新的开发工作,并计划修改当前使用此功能的应用程序。



另一个可能的原因可能是您在Visual Studio之后安装了SQL Server。



您可以在此处找到更多相关信息:

https://msdn.microsoft.com/en-us/library/ms254504.aspx [ ^ ]

https://msdn.microsoft.com/en-us/library/ms143684%28v=sql.105%29.aspx [< a href =https://msdn.microsoft.com/en-us/library/ms143684%28v=sql.105%29.aspx\"target =_ blanktitle =New Window> ^ ]

http://serverfault.com/questions/319912/i -am-very-confused-with-sql-server-express-instances-what-am-i-actual-connec [ ^ ]

http://stackoverflow.com/questions/4183485/what-are-in-sql-server-user-instances-that-make-them-impossible-in-non-express-e [ ^ ]

http://stackoverflow.com/q uestions / 4650183 / problem-with-creating-mdf-file-from-visual-studio-2010 [ ^ ]

https ://social.msdn.microsoft.com/Forums/sqlserver/en-US/6503fe05-4d05-49e7-8c2a-b9778ab7e9b8/connections-to-sql-server-files-mdf-require-sql-server-express-2005 ?forum = sqlsetupandupgrade [ ^ ]
Attaching an .mdf database file is a feature that is only supported for SQL Server Express. You either need to install the Express edition or attach it from within SQL Server Management Studio to make it a regular database instance. I would recommend the latter because (from MSDN):

"This feature will be removed in a future version of Microsoft SQL Server. Avoid using this feature in new development work, and plan to modify applications that currently use this feature."

Another possible cause might be that you installed SQL Server after Visual Studio.

You find more information about this here:
https://msdn.microsoft.com/en-us/library/ms254504.aspx[^]
https://msdn.microsoft.com/en-us/library/ms143684%28v=sql.105%29.aspx[^]
http://serverfault.com/questions/319912/i-am-very-confused-with-sql-server-express-instances-what-am-i-actually-connec[^]
http://stackoverflow.com/questions/4183485/what-are-in-sql-server-user-instances-that-make-them-impossible-in-non-express-e[^]
http://stackoverflow.com/questions/4650183/problem-with-creating-mdf-file-from-visual-studio-2010[^]
https://social.msdn.microsoft.com/Forums/sqlserver/en-US/6503fe05-4d05-49e7-8c2a-b9778ab7e9b8/connections-to-sql-server-files-mdf-require-sql-server-express-2005?forum=sqlsetupandupgrade[^]


这篇关于附加基于服务的数据库时如何解决错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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