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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T14:32:36+00:00 2026-05-15T14:32:36+00:00

DataTable tempTable = new DataTable; . . . tempTable = getCustomerTable(); In this case,

  • 0
DataTable tempTable = new DataTable;
.
.
.
tempTable = getCustomerTable();

In this case, tempTable will have a table (named CustomerInvoice) which has
5 columns. The 3rd column is named DueDate. I print to a listview
as following:

            for (int i = 0; i < tempTable.Rows.Count; i++)
            {
                DataRow row = tempTable.Rows[i];

                ListViewItem lvi = new ListViewItem(row["CuInvoiceID"].ToString());
                lvi.SubItems.Add(row["CustomerQuoteID"].ToString());
                lvi.SubItems.Add(row["DueDate"].ToString());

                lstvRecordsCInv.Items.Add(lvi);
            }

            tempTable.Clear();

This is how DueDate value looks like on UI:

alt text

I want it to look like this without time:

July 04, 2010
August 20, 2011

I prefer to solve this problem at application rather than db level.

NOTE: DueDate in database is of type datetime.

I’m coding in C# interacting with Sql-Server.

I hope my question is clear enough.

  • 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-15T14:32:37+00:00Added an answer on May 15, 2026 at 2:32 pm

    Instead of:

    lvi.SubItems.Add(row["DueDate"].ToString());
    

    You can do something like:

    DateTime lDate = row["DueDate"] as DateTime;
    lvi.SubItems.Add(lDate.ToString("MMMM dd, yyyy");
    

    The values in the “MMMM dd, yyyy” string come from MSDN here (you can also use standard date formats from here)

    If you want to do any actual calculations on just the date you could use lDate.Date

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

Sidebar

Related Questions

I have a datatable named testable, it has two columns id(primary key, int) and
I've a datatable which has a single text column 'Title' which can have multiple
I have a web user control, that has a table with 3 columns 1)
DataTable dt1 = new DataTable(); //I made this as a backup //add 3 columns
I have a datatable which contains yearly data saved. e.g. dtDate Value 2010-01-01 00:00:00.000
my DataTable has over 1000 columns and I want to display values on the
DataTable dt = new DataTable(); dt.Columns.Add(new DataColumn(gridColumn1, typeof(bool))); I was expecting the result of
In DataTable i have this format mm/dd/yyyy hh:mm:ss AM I want to change format
h:datatable created table like this column 1 column 2 item 1 item 1 item
First Datatable is dt var dt = new DataTable(); dt.Columns.Add(ID); dt.Columns.Add(First Name); dt.Rows.Add(1,name1); dt.Rows.Add(6,name6);

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.