Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7889433
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T06:05:55+00:00 2026-06-03T06:05:55+00:00

I want to develop on sql server database and use MySql for production. I’ve

  • 0

I want to develop on sql server database and use MySql for production.

I’ve created my database using SSMS Diagram and generated ADO.NET Enity Model in my ASP.NET MVC project. Then I modified connection string from Sql Server to point to MySql Server and specifically passed MySqlConnection object to DbContext. Now I’m trying to execute this below code but it complains that provided underlying connection is not of .NET Sql Server Connection type.

dbContext.CreateDatabase();
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-03T06:05:56+00:00Added an answer on June 3, 2026 at 6:05 am

    In the web.config you need to:

    • add the provider factory for MySQL (as shown above)
    • modify your connection string (or create a new one) where providerName attribute is set accordingly (something like <add name="NorthwindEntities" connectionString="metadata=NorthwindModel;provider=MySQL Data Provider;provider connection string="Data Source=.\SQLExpress;Initial Catalog=Northwind;Integrated Security=True"" providerName="System.Data.EntityClient"/>

    On top of these changes you need to have two SSDL files – one that is for Sql Server and one that is for MySQL. These files are specific to the store you use. They not only use the types the store understands but also have provider specific information (I put it in the {curly brackets}, sorry I don’t know an exemplary provider manifest token for my Sql):

    <Schema Namespace="NorthwindEFModel.Store" Alias="Self" xmlns="http://schemas.microsoft.com/ado/2009/11/edm/ssdl"
        Provider="{MySQL Data Provider}" ProviderManifestToken="{Provider manifest token}">
    

    I think you can save some hassle if you use code first. You will create and possibly configure your model using code (classes + DbContext.OnModelCreating()) and have EF create the database for you. Depending on your connection string (which in this case will be a “regular” connection string and not Entity Connection String) it will be talking either to Sql Server or MySQL and will create database accordingly.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to develop a generic CRM application using SQL Server 2008. The application
I develop desktop-based WPF-application, that uses SQL Server 2008 R2 Database and ADO.NET Entity
I want to develop an application that stores user's data on an SQL server.
We develop a set of industrial applications that use SQL Server. As demand expands,
i want to develop one desktop application using c# sql lite, this application i
I want develop some web product with using javascript 3d library like three.js But
I want to develop a windows application. If I use native C++ and MFC
Which lightweight SQL Server type could I use on my Dev machine for a
I am using SQL Server 2008 Enterprise + VSTS 2008 + C# + .Net
I am using VSTS 2008 + C# + .Net 3.5 + SQL Server 2008

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.