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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T13:11:16+00:00 2026-06-09T13:11:16+00:00

I have a problem inserting a row using Entity Framework with the MySQL Connector/NET

  • 0

I have a problem inserting a row using Entity Framework with the MySQL Connector/NET 6.4.4. When I try to save the changes after adding 1 row I get a System.NullReferenceException with the following stack-trace:

at MySql.Data.Entity.SqlGenerator.GenerateReturningSql(DbModificationCommandTree tree, DbExpression returning) 
at MySql.Data.Entity.UpdateGenerator.GenerateSQL(DbCommandTree tree) 
at MySql.Data.MySqlClient.MySqlProviderServices.CreateDbCommandDefinition(DbProviderManifest providerManifest, DbCommandTree commandTree) 
at System.Data.Common.DbProviderServices.CreateCommandDefinition(DbCommandTree commandTree) 
at System.Data.Common.DbProviderServices.CreateCommand(DbCommandTree commandTree) 
at System.Data.Mapping.Update.Internal.UpdateTranslator.CreateCommand(DbModificationCommandTree commandTree) 
at System.Data.Mapping.Update.Internal.DynamicUpdateCommand.CreateCommand(UpdateTranslator translator, Dictionary`2 identifierValues) 
at System.Data.Mapping.Update.Internal.DynamicUpdateCommand.Execute(UpdateTranslator translator, EntityConnection connection, Dictionary`2 identifierValues, List`1 generatedValues) 
at System.Data.Mapping.Update.Internal.UpdateTranslator.Update(IEntityStateManager stateManager, IEntityAdapter adapter) 
at System.Data.EntityClient.EntityAdapter.Update(IEntityStateManager entityCache) 
at System.Data.Objects.ObjectContext.SaveChanges(SaveOptions options) 
at System.Data.Entity.Internal.InternalContext.SaveChanges() 
at System.Data.Entity.Internal.LazyInternalContext.SaveChanges() 
at System.Data.Entity.DbContext.SaveChanges() 
at UserData.Repository.DBRepositoryDataContext.SaveChanges() in C:\SoftwareProjects\Java\Degoo\Server\UserData\Repository\DBRepositoryDataContext.cs:line 42 
at UserData.Repository.Repository.<SaveChanges>b__1() in C:\SoftwareProjects\Java\Degoo\Server\UserData\Repository\Repository.cs:line 137 
at Microsoft.AppFabricCAT.Samples.Azure.TransientFaultHandling.RetryPolicy`1.ExecuteAction(Action action) in C:\SoftwareProjects\Java\Degoo\Server\Libraries\TransientFaultHandlingFramework\RetryPolicy.cs:line 352 

I’m using EF 4.1 with “code first”. In other words: I use DbSet and DbContext.

This is what the entity I’m trying to add looks like in EF’s change-tracker:

     System.Data.Entity.Infrastructure.DbEntityEntry<Utilities.IStandardEntity> 
_internalEntityEntry    System.Data.Entity.Internal.InternalEntityEntry 
CurrentValues       System.Data.Entity.Infrastructure.DbPropertyValues 
Entity      UserData.PerformanceCounterEntities.PerformanceCounterEntity 
CallingClassName    "com.degoo.tests.integration.PerformanceCounterUploaderTest"    string 
Category    {System.Data.Entity.DynamicProxies.TextEntity_27BF3732ED645CE792F48B4AA75BFD05C10C0AE9C5B35779176C02A53A587F1A} UserData.PerformanceCounterEntities.TextEntity {System.Data.Entity.DynamicProxies.TextEntity_27BF3732ED645CE792F48B4AA75BFD05C10C0AE9C5B35779176C02A53A587F1A} 
CategoryTextID  1   long 
CreationTime    {2011-11-09 09:32:12}   System.DateTime 
Description {System.Data.Entity.DynamicProxies.TextEntity_27BF3732ED645CE792F48B4AA75BFD05C10C0AE9C5B35779176C02A53A587F1A} UserData.PerformanceCounterEntities.TextEntity {System.Data.Entity.DynamicProxies.TextEntity_27BF3732ED645CE792F48B4AA75BFD05C10C0AE9C5B35779176C02A53A587F1A} 
DescriptionTextID   3   long 
ID  0   long 
ModificationTime    {2011-11-09 09:32:12}   System.DateTime 
Name    {System.Data.Entity.DynamicProxies.TextEntity_27BF3732ED645CE792F48B4AA75BFD05C10C0AE9C5B35779176C02A53A587F1A} UserData.PerformanceCounterEntities.TextEntity {System.Data.Entity.DynamicProxies.TextEntity_27BF3732ED645CE792F48B4AA75BFD05C10C0AE9C5B35779176C02A53A587F1A} 
NameTextID  2   long 
NodeID  16485   long 
NumberOfSamples 1   long 
RowVersion  0   long 
Value   1.0 double

Any ideas on what’s causing this? It looks like a bug in MySQL’s EF-drivers (at least they should update then to provide a better error-message).

  • 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-09T13:11:18+00:00Added an answer on June 9, 2026 at 1:11 pm

    I had a similar problem, using the same connector driver. In my case, one of the objects was using atributes instead of properties.

    public class User : ProjectBasicEntity
    {
       public string SomeColumn;
    }
    

    Instead of

    public class User : ProjectBasicEntity
    {
       public string SomeColumn { get; set;}
    }
    

    I guess someone REALLY needs to improve the error handling in those drivers…

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

Sidebar

Related Questions

I have a problem inserting a row in a MySQL table when the table
i have a problem in inserting the listbox value into mysql database in vb
i have a problem in inserting the listbox value into mysql database in vb
I am having a problem with inserting a new row in database using Doctrine
I have problem inserting rows to my DB. When a row contains characters like:
I am using the Entity Framework 4.2 and I have a fairly serious performance
I am having a very strange problem with an ASP.Net project using an Entity
I have a problem with inserting data into SQLite database using QSqlTableModel. The table
I have a problem inserting values on my table. -------------------------------------------- | products_id | related_products_ids
I have a problem when inserting an image in an ImageView. I have tried

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.