11
Answers

how can get the date in this format "31-jun-2013"

Ask a question
kumartyr

kumartyr

11y
1.2k
1
how can i get the date in this format "31-jun-2013" 

at runtime if user type in the above format in the textbox ..it will fetch the matching rows of data for the specified date and filter that and show in datagridview 

so for that i want to compare the date format with the text typed in textbox

   string todaydate = Convert.ToString(DateTime.Today);

   DateTime DTM = Convert.ToDateTime(Date);

   string datetoday = DTM.ToString("dd-MMM-yyyy");

if (TypeHereTextBox.Text == datetoday)

{
OLCMND2 = new OracleCommand("Select * from TABLENAME where DATE = '" + TypeHereTextBox.Text + "'", CON);

                    OADAP1 = new OracleDataAdapter(OLCMND2);
                    OADAP1.Fill(DTBLE2);

                    DatagridView.DataSource = DTBLE2;
}

how can it be solved 

Answers (11)