Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to remove timestamp from GridView
    primarykey
    data
    text
    <p>I populate a textbox with date from a datepicker with <code>Calendar1.SelectedDate.ToShortDateString();</code>, after which I store in an Oracle database with a query shown below</p> <pre><code>string query3 = "insert into leave_module1 values(:srno,:name,:desig,:tol,:compdates,:fd,:td,:nod,:da,:ds,st.nextval)"; OracleCommand cmd = new OracleCommand(query3, con); try { cmd.Parameters.Add(":srno", OracleType.Number, 8).Value = DropDownList2.Text; cmd.Parameters.Add(":name", OracleType.VarChar, 50).Value = TextBox8.Text; cmd.Parameters.Add(":desig", OracleType.VarChar, 30).Value = TextBox10.Text; cmd.Parameters.Add(":tol", OracleType.VarChar, 10).Value = DropDownList1.Text; cmd.Parameters.Add(":compdates", OracleType.VarChar, 30).Value = TextBox9.Text; cmd.Parameters.Add(":fd", OracleType.DateTime).Value = TextBox3.Text; cmd.Parameters.Add(":td", OracleType.DateTime).Value = TextBox4.Text; cmd.Parameters.Add(":nod", OracleType.Number, 3).Value = TextBox5.Text; cmd.Parameters.Add(":da", OracleType.DateTime).Value = TextBox11.Text; cmd.Parameters.Add(":ds", OracleType.DateTime).Value = TextBox7.Text; cmd.ExecuteNonQuery(); ClientScript.RegisterStartupScript(Page.GetType(), "validation", "&lt;script language='javascript'&gt;alert('The Data has been added');window.location='Default2.aspx';&lt;/script&gt;;"); } catch { Label13.Visible = true; } </code></pre> <p>But when I populate a GridView in another page with the stored dates, I get a timestamp even though I did not input one. Please tell me how to remove the timestamp from the display!</p> <p>Thanks in advance</p> <p>This is how I populate the gridview</p> <pre><code>protected void Button3_Click(object sender, EventArgs e) { string v = System.Configuration.ConfigurationManager.ConnectionStrings["harish"].ConnectionString; con = new OracleConnection(v); con.Open(); cmd = new OracleCommand("select * from leave_module1 where srno='"+DropDownList1.Text+"'", con); dr = cmd.ExecuteReader(); GridView1.DataSource = dr; GridView1.DataBind(); con.Close(); dr.Close(); } </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload