为了开发目的,我使用向导在 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 开发服务器并运行了它。
当我这样做并检查数据库时,它会更新实时副本和开发副本。我错过了什么?
谢谢,保罗