【发布时间】:2011-07-23 10:26:44
【问题描述】:
我使用在 Visual Studio 2010 中将数据库附加到我的服务器资源管理器,而不是使用我安装在我的电脑上的到 sql server 2008 的连接。
示例: 我的连接字符串以前是这样的:
<add name="YourGuruDB"
connectionString="Data Source=DIMA-00AA1DA557;Initial Catalog=model;Integrated Security=True"/>
现在变成了这样:
<add name="YourGuruDB"
connectionString="Data Source=.\SQLEXPRESS;AttachDbFilename='C:\Documents and Settings\Little Rabbit\Desktop\New Folder (2)\YourGuruDB1.mdf';Integrated Security=True;Connect Timeout=30;User Instance=True"
providerName="System.Data.SqlClient"/>
我选择连接数据库的方式有什么不同(例如,在性能、安全性或舒适性方面)?
【问题讨论】:
标签: asp.net database-connection connection-string