且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

自动将数据库附加到sql express

更新时间:2022-11-24 20:00:47

在连接字符串中传递您的凭据.
并使用集成安全性的持久性安全信息
Pass your credential in connection string.
and use Persist Security Info instaed of Integrated Security
Data Source=.\SQLEXPRESS; AttachDBFileName=|DataDirectory|\MyDBName.mdf;
Persist Security Info=True;User ID=youruserid;Password=password"



检查更多连接字符串
http: //www.connectionstrings.com/sql-server-2008 [ ^ ]



check more connectionstrings
http://www.connectionstrings.com/sql-server-2008[^]