【发布时间】:2012-11-07 16:36:00
【问题描述】:
我使用向导在 SQL Server R2 中为开发目的制作了一个数据库副本。那部分工作得很好。在我的代码中,我将 web.config 中的连接字符串更改为指向新的数据库:
<add name="myConnectionString" connectionString="Data Source=\dev;Initial Catalog=live_DEV;Integrated Security=True" providerName="System.Data.SqlClient"/>
<!--<add name="liveConnectionString" connectionString="Data Source=\dev;Initial Catalog=live;Integrated Security=True" providerName="System.Data.SqlClient"/>-->
出于安全原因,我更改了服务器的实际名称等,但格式相同。如您所见,我已将旧数据库注释掉并更改为副本。
我正在使用 VS2010,并将所有引用从旧连接更改为我的开发副本:
using (SqlConnection connIncident_TrackerDB = new SqlConnection(@"Data Source=\dev;Initial Catalog=live_DEV;Integrated Security=True"))
{
我已经检查了我的开发副本中的存储过程,它们都以 [USE live_DEV] 作为标题。我已经清理并重建了代码。我已重新启动我的 ASP.NET 开发服务器并运行它。
当我检查数据库时,它会同时更新实时副本和开发副本。我错过了什么?
谢谢, 保罗
【问题讨论】:
标签: asp.net visual-studio-2010 sql-server-2008 c#-4.0