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 8952861
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T13:58:02+00:00 2026-06-15T13:58:02+00:00

Im using The mysql driver 6.6.4 and EF 4.4.0.0. My context can create the

  • 0

Im using The mysql driver 6.6.4 and EF 4.4.0.0. My context can create the database, It has also created a _MigrationHistory Table, i can insert, List, Delete records.

I can add an action with a create model, and auto create the model, everything is perfect
here is my context for claritty

public class MyContext : DbContext
{
    static MyContext()
    {
        Database.SetInitializer<MyContext>(null);
    }

    public MyContext()
        : base("Name=MyContext")
    {
    }

    public DbSet<AdminUser> AdminUsers { get; set; }
    public DbSet<Feedback> Feedbacks { get; set; }
    public DbSet<Navigation> Navigations { get; set; }
    public DbSet<SiteLink> SiteLinks { get; set; }
    public DbSet<SiteNew> SiteNews { get; set; }
    public DbSet<StockList> StockLists { get; set; }
    public DbSet<SubNavigation> SubNavigations { get; set; }

    protected override void OnModelCreating(DbModelBuilder modelBuilder)
    {
        modelBuilder.Configurations.Add(new AdminUserMap());
        modelBuilder.Configurations.Add(new FeedbackMap());
        modelBuilder.Configurations.Add(new NavigationMap());
        modelBuilder.Configurations.Add(new SiteLinkMap());
        modelBuilder.Configurations.Add(new SiteNewMap());
        modelBuilder.Configurations.Add(new StockListMap());
        modelBuilder.Configurations.Add(new SubNavigationMap());


    }

my constring is the same name as my context, as said this all works. I have also added the Data Provider to my web.config file.

I Have even added some code in the create a stored procedure and this all works fine, bottom line everything looks really good here and as far as im concerned i have done everything right that i could possibly do.

but when I create a controller I get this: [ using the create controller with create, edit, delete options )

enter image description here

Now there is quite a bit of noise about this on here, and on the web but I have actually covered everything. I have even set my dbContext to just be DbSets and nothing else. This has been burning my head for quite some time now and I have done everything and read everything possible before making the move of asking on here.

Now I know this wuld probably be far easier with SQL Server etc etc, however i do not have that option, I have a very good mysql cluster and many sites using EF and code first, problems seem to start when I installed asp.net MVC 4 and upgraded to the latest .net.

Any ideas please, I will try anything

web.config

<configuration>
<configSections>
<section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=4.4.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
   <!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 -->
 </configSections>
 <connectionStrings>
  <add name="MyContext" connectionString="server=localhost;database=MyDB;user id=myuser; password=mypass; Pooling=false" providerName="MySql.Data.MySqlClient" />
 </connectionStrings>
<appSettings>
  <add key="webpages:Version" value="2.0.0.0" />
  <add key="webpages:Enabled" value="false" />
  <add key="PreserveLoginUrl" value="true" />
  <add key="ClientValidationEnabled" value="true" />
  <add key="UnobtrusiveJavaScriptEnabled" value="true" />
</appSettings>
<system.web>
  <compilation debug="true" targetFramework="4.0" />
  <pages controlRenderingCompatibilityVersion="4.0" clientIDMode="AutoID">
    <namespaces>
      <add namespace="System.Web.Helpers" />
      <add namespace="System.Web.Mvc" />
      <add namespace="System.Web.Mvc.Ajax" />
      <add namespace="System.Web.Mvc.Html" />
      <add namespace="System.Web.Routing" />
      <add namespace="System.Web.WebPages" />
    </namespaces>
  </pages>
</system.web>
<system.data>
  <DbProviderFactories>
       <remove invariant="MySql.Data.MySqlClient" />
     <add name="MySQL Data Provider" invariant="MySql.Data.MySqlClient" description=".Net Framework Data Provider for MySQL" type="MySql.Data.MySqlClient.MySqlClientFactory, MySql.Data, Version=6.6.4.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d" />
   </DbProviderFactories>
 </system.data>
   <runtime>
     <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
       <dependentAssembly>
       <assemblyIdentity name="EntityFramework" publicKeyToken="b77a5c561934e089" culture="neutral" />
       <bindingRedirect oldVersion="0.0.0.0-4.4.0.0" newVersion="4.4.0.0" />
    </dependentAssembly>
      <dependentAssembly>
        <assemblyIdentity name="MySql.Data" publicKeyToken="c5687fc88969c44d" culture="neutral" />
        <bindingRedirect oldVersion="0.0.0.0-6.6.4.0" newVersion="6.6.4.0" />
      </dependentAssembly>
    </assemblyBinding>
  </runtime>
  <system.webServer>
    <modules runAllManagedModulesForAllRequests="true" />
    <handlers>
      <remove name="ExtensionlessUrlHandler-ISAPI-4.0_32bit" />
      <remove name="ExtensionlessUrlHandler-ISAPI-4.0_64bit" />
      <remove name="ExtensionlessUrlHandler-Integrated-4.0" />
      <add name="ExtensionlessUrlHandler-ISAPI-4.0_32bit" path="*." verb="GET,HEAD,POST,DEBUG,PUT,DELETE,PATCH,OPTIONS" modules="IsapiModule" scriptProcessor="%windir%\Microsoft.NET\Framework\v4.0.30319\aspnet_isapi.dll" preCondition="classicMode,runtimeVersionv4.0,bitness32" responseBufferLimit="0" />
       <add name="ExtensionlessUrlHandler-ISAPI-4.0_64bit" path="*." verb="GET,HEAD,POST,DEBUG,PUT,DELETE,PATCH,OPTIONS" modules="IsapiModule" scriptProcessor="%windir%\Microsoft.NET\Framework64\v4.0.30319\aspnet_isapi.dll" preCondition="classicMode,runtimeVersionv4.0,bitness64" responseBufferLimit="0" />
        <add name="ExtensionlessUrlHandler-Integrated-4.0" path="*." verb="GET,HEAD,POST,DEBUG,PUT,DELETE,PATCH,OPTIONS" type="System.Web.Handlers.TransferRequestHandler" preCondition="integratedMode,runtimeVersionv4.0" />
     </handlers>
       </system.webServer>
      <entityFramework>
      <defaultConnectionFactory type="System.Data.Entity.Infrastructure.LocalDbConnectionFactory, EntityFramework">
         <parameters>
         <parameter value="v11.0" />
       </parameters>
     </defaultConnectionFactory>
  </entityFramework>
  </configuration>

model:

public class AdminUser
{
    public int Id { get; set; }
    public string UserName { get; set; }
    public string Password { get; set; }
    public string Email { get; set; }
    public short UserLevel { get; set; }
}

mapping

public class AdminUserMap : EntityTypeConfiguration<AdminUser>
{
    public AdminUserMap()
    {
        // Primary Key
        this.HasKey(t => t.Id);

        // Properties
        this.Property(t => t.UserName)
            .IsRequired()
            .HasMaxLength(50);

        this.Property(t => t.Password)
            .IsRequired()
            .HasMaxLength(50);

        this.Property(t => t.Email)
            .HasMaxLength(150);

        // Table & Column Mappings
        this.ToTable("AdminUsers", "eyebag");
        this.Property(t => t.Id).HasColumnName("Id");
        this.Property(t => t.UserName).HasColumnName("UserName");
        this.Property(t => t.Password).HasColumnName("Password");
        this.Property(t => t.Email).HasColumnName("Email");
        this.Property(t => t.UserLevel).HasColumnName("UserLevel");
    }
}
  • 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-15T13:58:03+00:00Added an answer on June 15, 2026 at 1:58 pm

    well it seems that the simplest of solutions to this was to download the nuget package MvcScaffolding, and then use the MVCScaffolding version of add controller with EF create, edit, delete this version works and settles my problems, why the other option does not work will probably be unknown, but thanks for everyones help and sudgestions

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

Sidebar

Related Questions

I am using the MySQL driver for Node.js node-mysql but struggling with the syntax
I have been using CI just fine using the MySQL driver. I want to
I am using following prepared statement : Class.forName(com.mysql.jdbc.Driver); con=DriverManager.getConnection(jdbc:mysql://localhost:3306/mysql,root,root); String query=select ename from ?
Using MySQL, How do I import a user defined database function from one db
Using MySQL, I have a simple table that logs the IP Address that users
I am using nodejs and the node-mysql driver. I find myself doing repetitive boiler
I am collecting data and store this data in a MySQL database using Java.
I have an application using Spring with Hibernate on a MySQL database. For some
I'm creating an online chat. Context (if needed): So far I was using PHP/MySQL
I am Using Mysqli Driver. I am getting Command out of sync when i

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.