将应用程序从MySQL数据库移动到SQL Server [英] Moving application from MySQL database to SQL Server

查看:102
本文介绍了将应用程序从MySQL数据库移动到SQL Server的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

我的代码中有一个非常有趣的行为,我无法理解:

I have a very interesting behavior in my code that I cannot understand:

我创建了一个应用程序(一个月前的ASP.NET MVC)本来应该与MySQL一起工作。它做得非常好,但我们即将改变基础设施,在新的基础设施中他们有SQL Server,所以我想从MySQL迁移到SQL Server。

I created an application (ASP.NET MVC) a month ago that was supposed to work with MySQL. It did so very well but we are about to change infrastructure and in the new one they have SQL Server so I wanted to move from MySQL to SQL Server.

为了进行迁移数据库提供程序,我在web.config文件中删除了对MySQL的所有提及,并替换了SQL Server配置等价物所需的位置。

In order to do the migration of database provider, I removed all the mentions to MySQL in the web.config file and replaced where needed by SQL Server configuration equivalents.

毕竟,我的程序仍尝试使用MySQL提供程序进行连接我无法理解为什么...

After all that, my program still tries to connect using MySQL provider and I can't get to know why...

以下是有关数据库的web.config文件位,如果有帮助的话:

Here is the web.config file bits regarding database if it can help:

<section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />

  <connectionStrings>
    <add name="XYZ" connectionString="Data Source=(local)\sqlexpress;Initial Catalog=XYZ;Integrated Security=True" providerName="System.Data.SqlClient" />
  </connectionStrings>

  <entityFramework>
    <defaultConnectionFactory type="System.Data.Entity.Infrastructure.SqlConnectionFactory, EntityFramework" />
    <providers>
      <provider invariantName="System.Data.SqlClient" type="System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer" />
    </providers>
  </entityFramework>

我尝试启动应用程序时收到的错误消息是:

The error message received when I try to start the application is:

此外,我的应用程序首先使用代码和迁移,当我尝试向项目添加新迁移时也会显示错误。

Also my application uses code first and migrations and the error shows also when I try to add a new migration to the project.

有任何线索吗?

非常感谢提前。

推荐答案

Hi CFDSO,

Hi CFDSO,

欢迎来到MSDN论坛。

Welcome to the MSDN forum.

根据您的描述,当您将MySQL更改为SQL Server时出现问题asp.net MVC应用程序。由于我们的论坛是讨论.NET Framework安装和服务,您的问题与MVC应用程序的开发更相关,
请访问相应的支持论坛:
https://forums.asp.net/1146.aspx
并为您的问题开始一个新的主题,您将从那里获得更专业的支持,谢谢为了您的理解。

According to your description, you have issue when you changed MySQL to SQL Server in your asp.net MVC application. Since our forum is to discuss the .NET Framework Setup and Servicing, your issue is more related to the development of the MVC application, please access the corresponding support forum: https://forums.asp.net/1146.aspx and start a new thread for your issue, you will get a more professional support from there, thank you for your understanding.

祝你好运,

Sara


这篇关于将应用程序从MySQL数据库移动到SQL Server的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆