简体   繁体   English

使用EF的asp.net应用程序无法与SQL Server进行数据库镜像

[英]Database mirroring with sql server does not work with my asp.net application using EF

I have database mirroring setup to work with the production database for my asp.net application. 我具有数据库镜像设置,可以与asp.net应用程序的生产数据库一起使用。 When the system fails over to the mirrored database, the application crashes because the connection string is invalid. 当系统故障转移到镜像数据库时,由于连接字符串无效,应用程序崩溃。

If the failover is dependent on a connection string, what kinds of changes do I need to make to my application in order to ensure that it can fail over without my manually changing the connection string? 如果故障转移取决于连接字符串,那么我需要对应用程序进行哪些更改,以确保无需手动更改连接字符串就可以进行故障转移?

Do I put exception handling behavior around the EF code where it automatically changes its connection string? 是否在自动更改其连接字符串的EF代码周围放置异常处理行为?

Depending on the type of failover you have set up, I believe there is a connection string property that you can specify the failover DB. 根据您设置的故障转移类型,我相信有一个连接字符串属性可以指定故障转移数据库。

Data Source=myServerAddress;Failover Partner=myMirrorServerAddress;Initial Catalog=myDataBase;Integrated Security=True;

From here: http://www.connectionstrings.com/sql-server-2008 从这里: http : //www.connectionstrings.com/sql-server-2008

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 SQL Server数据库镜像和ASP.Net应用程序 - Sql Server database mirroring and ASP.Net applications 将我的Web服务器上的asp.net应用程序连接到另一台服务器上的sql数据库的方法? - Ways to connect my asp.net application on my web server to a sql database on another server? 如何进行ASP.NET网站和SQL镜像 - How to ASP.NET Site and SQL Mirroring 卡在 asp.net 核心教程中。 尝试使用 package 管理器控制台添加 EF Core SQL 服务器提供程序不起作用 - Stuck in asp.net core tutorial. Trying to use package manager console to add EF Core SQL Server provider does not work Import Excel file using .NET Core ASP.NET Web Application to SQL Server database - Import Excel file using .NET Core ASP.NET Web Application to SQL Server database 我可以使用SQL Server安全性来控制对(数据库优先)ASP.net应用程序的访问吗? 怎么样? - Can I use SQL Server security to control access to my (database first) ASP.net application? How? 从ASP.NET应用程序连接到SQL Server数据库时出现问题 - Problem connecting to a SQL server database from a ASP.NET application 将SQL Server数据库连接到ASP.NET应用程序版本 - Connecting SQL Server database to ASP.NET application release 从asp.net应用程序连接到SQL Server数据库 - connect to sql server database from asp.net application 简单的ASP.net SQL Server数据库编辑器应用程序 - Simple ASP.net SQL Server database editor application
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM