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

  • SEARCH
  • Home
  • 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 3609232
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T21:36:03+00:00 2026-05-18T21:36:03+00:00

I am creating a database application using Visual C# Express and MySQL. The issue

  • 0

I am creating a database application using Visual C# Express and MySQL. The issue is that I only want to store data to the database from the C# forms if the data has actually been changed, the way I do it now is that when the ‘Save’ button is clicked all the all the fields in the form are saved into the database, whether or not they have been changed.

The solution I have come up with is just to check for every field in the form if it has been changed and then change the SQL command accordingly, i.e.

//when the details are loaded into the form
String strOriginalName = txtFirstname.Text;

//when the save button is checked
if(strOriginalName != txtFirstname.Text)
{
String strUpdate = "UPDATE table SET firstName = txtFirstname.Text";
MySqlCommand cmdUpdate = new MySqlCommand(strUpdate, connection);
cmdUpdate.ExecuteNonQuery();
} 

Does anyone else have a better or alternative solution? Thank you for your help, if I was vague in any part, please let me know and I can try explain further.

  • 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-18T21:36:04+00:00Added an answer on May 18, 2026 at 9:36 pm

    I suggest to use some OR Mapper (NHibernate) for example. It will do it all for you. In addition this will give you caching and other cool things for free 🙂

    Lessons learned for future are priceless and your next applications will be grow faster and faster. 🙂

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

Sidebar

Related Questions

I am creating a small application that will be deployed on Window. The database
I'm creating an AIR application which connects to a SQLite database. The database balks
Using DTS I'm dynamically creating an access database. After the file is created (which
We currently deploy web applications by creating a database and running SQL scripts through
When creating a database structure, what are good guidelines to follow or good ways
I'm tired of opening Dia and creating a database diagram at the beginning of
I would like to learn the best practices to employ when creating a database
I am creating a mock database for import export tests (of the algorithm reading
When I am creating a new database table, what factors should I take into
What are the best practices around creating flat file database structures in PHP? A

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.