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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T09:16:02+00:00 2026-06-06T09:16:02+00:00

I populate a textbox with date from a datepicker with Calendar1.SelectedDate.ToShortDateString(); , after which

  • 0

I populate a textbox with date from a datepicker with Calendar1.SelectedDate.ToShortDateString();,
after which I store in an Oracle database with a query shown below

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", "<script language='javascript'>alert('The Data has been added');window.location='Default2.aspx';</script>;");
}
catch
{
    Label13.Visible = true;
}

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!

Thanks in advance

This is how I populate the gridview

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();
}
  • 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-06T09:16:04+00:00Added an answer on June 6, 2026 at 9:16 am

    So you are querying all the columns from the database and then auto-generating the columns. This is why all the columns are displayed. To resolve this

    1. adjust the query to only return the columns that are actually required
    2. disable auto-generate columns and define the columns yourself.

    rarely do you want to use auto-generated anything, as you loose call control to customize the behavior and output.

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

Sidebar

Related Questions

i have a textbox which is filled with date from a datepicker(calendar is accessed
I am using the ui date picker widget here: http://jqueryui.com/demos/datepicker/ to populate this: <input
In my web application, I've set of checkboxes which on check populate a textbox
I want to populate my textbox with value from an element. Perhaps my code
I am trying to populate the textbox inside a usercontrol with value from the
I need to be able to grab the selected date from the Datepicker and
I've got a DataGrid with 6 columns: ComboBox;ComboBox;CheckBox;CheckBox;CheckBox;TextBox I'm trying to populate this DataGrid
I populate a DataGrid from a CollectionViewSource. Each row has a delete button. On
I populate the GridView.DataSource from a EntityFramework Model: gwTimeLog.DataSource = _entities.TimeLogs; When a new
I'm trying to populate a List of beans from a form: public class Foo

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.