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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T00:22:03+00:00 2026-06-16T00:22:03+00:00

I am working on a database driven c# application. I have a datatable that

  • 0

I am working on a database driven c# application.

I have a datatable that has a date column in it. Bind this datatable to datagridview and let the user edit the records and upon clicking save, save these changes in the database.

Date format in grid changes based on the system settings between dd/MM/yyyy and MM/dd/yyyy.

Data entry operators are not smart enough to look at this difference, so while editing the records they sometime move the records to different month.

Date Format is dd/MM/yyyy 10/10/2010

They want to change it to 12th October from 10th October. They made this change 10/12/2010 assuming the date format is MM/dd/yyyy.

There always remains this problem, so I want to fix the date format in the datatable.

What are the approaches I could use?

  • 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-16T00:22:03+00:00Added an answer on June 16, 2026 at 12:22 am

    Use this code

    var style = new DataGridViewCellStyle();
    style.Format = "dd-MMM-yy";
    colDate.DefaultCellStyle = style;
    

    You don’t need to convert it back and forth, it’ll do all the things you want to achieve,

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

Sidebar

Related Questions

I'm working on a database-driven web application that must keep track of tasks that
Hello, stackoverflow community! I am working on a rather large database-driven web application. The
I’m writing an CI application that has to have authentication and preferably different roles
We have a Java desktop application that accesses a Derby database located on a
I am working on a data driven web application that uses a SQL 2005
I'm working on an Android application that stores data in a SQLite database. My
I have a database working in my local sql server 2005 express edition. I
Does anybody have an example of working with database using Visual C++ and OLEDB?
I am working on a database that is expected to operate over multiple distributed
I'm working on an rather small application (C#, winform) that is kind of front-end

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.