如何编写用于连接数据库(.mdf)文件的连接字符串? [英] How to write Connection string for connecting Database (.mdf) file not attaching?

查看:376
本文介绍了如何编写用于连接数据库(.mdf)文件的连接字符串?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是通过.mdf文件连接数据库的更好方法吗?



数据源= 192.168.123.123,1433; AttachDbFilename = C:\Program Files \ Microsoft SQL Server \ MSSQL10_50.MSSQLSERVER \ MSSQL \DATA\Test.mdf;用户ID = sa;密码= 1234

它正在工作,但我可以使用此AttachDbFilename属性这是更好还是没有?

解决方案

问题:这是通过.mdf文件连接数据库的更好方法吗?是..至少奇怪。如果要附加数据库,则只有一种方法可以执行此操作。



可用连接字符串列表如下: http:// www .connectionstrings.com / sql-server / [ ^

IS this better way to connect the Database through .mdf file?

"Data Source=192.168.123.123,1433;AttachDbFilename=C:\Program Files\Microsoft SQL Server\MSSQL10_50.MSSQLSERVER\MSSQL\DATA\Test.mdf;User ID=sa;Password=1234"
it is working but can i use this AttachDbFilename attribute on this is it better or not?

解决方案

The question: IS this better way to connect the Database through .mdf file? is... strange at least. If you want to attach database, there is only one way to do it.

List of available connection strings is here: http://www.connectionstrings.com/sql-server/[^]


这篇关于如何编写用于连接数据库(.mdf)文件的连接字符串?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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