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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T10:20:24+00:00 2026-05-31T10:20:24+00:00

I’m trying to get my MVC3 application to use MySql database instead of Sql

  • 0

I’m trying to get my MVC3 application to use MySql database instead of Sql Server 2008. I have created the associated database and objects in Mysql. And Updated the connection string in my web.config file to reference MySql.Data.MySqlClient.

When I run my application and try to login, I am getting the error

Store update, insert, or delete statement affected an unexpected number of rows (0). Entities may have been modified or deleted since entities were loaded. Refresh ObjectStateManager entries.

I have a custom MembershipProvider and within the validation process I have the following

 using (MyContext context= new MyContext())
 {
      --some checks here
      ---
        if (verificationSucceeded)
        {
            user.passwordFailuresSinceLastSuccess = 0;
        }
        else
        {
            int failures = user.passwordFailuresSinceLastSuccess;
            if (failures != -1)
            {
                user.passwordFailuresSinceLastSuccess += 1;
                user.lastPasswordFailureDate = DateTime.UtcNow;
            }
        }
        context.SaveChanges();  ----THIS IS WHERE IT FALLS OVER
         -- some other code here 
    }

The above code works perfectly well with Sql Server 2008, but is falling over only with MySql. Any idea how I can resolve this please?

I do not have any triggers defined on the underlying table btw. The application is MVC3 with EF Code First.
Thanks,

  • 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-05-31T10:20:26+00:00Added an answer on May 31, 2026 at 10:20 am

    If anybody else is having this issue, the problem was with the Guid as I though. To get over this, add the following to your connection string

    Old Guids=true

    So for example, my connection string looks like this now.

    <add name="MyDB" connectionString="Server=localhost; Database=mydatabase; Uid=user; Pwd=mypass; Old Guids=true;" providerName="MySql.Data.MySqlClient" />
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to understand how to use SyndicationItem to display feed which is
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I'm trying to use string.replace('’','') to replace the dreaded weird single-quote character: ’ (aka
I have a reasonable size flat file database of text documents mostly saved in
I am trying to loop through a bunch of documents I have to put
Basically, what I'm trying to create is a page of div tags, each has
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have just tried to save a simple *.rtf file with some websites and
this is what i have right now Drawing an RSS feed into the php,
I am trying to render a haml file in a javascript response like so:

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.