Hi I am trying to get the date from a sql table however whenever I get it, it returns with the time. Even though in the database table it does not have a time.
con.Open();
OdbcCommand cmd = con.CreateCommand();
cmd.CommandType = CommandType.Text;
cmd.CommandText = "Select I_InvoiceNo, I_Date from tblOrdInvoice where O_OrderNo = '" + orderNoTxt.Text + "'";
cmd.ExecuteNonQuery();
con.Close();
DataTable dt = new DataTable();
OdbcDataAdapter sda = new OdbcDataAdapter(cmd);
sda.Fill(dt);
foreach (DataRow dr in dt.Rows)
{
invoiceNoTxt.Text = dr["I_InvoiceNo"].ToString();
invoiceDateTxt.Text = dr["I_Date"].ToString();
}
The date is being returned as "27/03/2017 00:00:00" . I only want the date. Any Help please.