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:
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.