i have a form in which am displaying data in datagridview from DB & i also have a textbox in which am able to autocomplete strings of other columns and search in datagridview and get the matching data filtered and displayed in datagridview but not able to do that for date column
how to do autocomplete for date alone [not with time] in textbox in required format "dd-mm-yyyy" and fetch the matching date column to display in datagriview
i have tried the below code but it doesn't works
AutoCompleteStringCollection ACSCVV = new AutoCompleteStringCollection();
OLCMND3 = new OracleCommand("Select to_date(to_char(TODAYDATE, 'dd-mm-yyyy'),'dd-mm-yyyy HH:MI:SS') as TODAYDATE from TABLENAME order by NUMBER asc", CON);
DR1 = OLCMND3.ExecuteReader();
if (DR1.HasRows == true)
{
while (DR1.Read())
{
ACSCVV.Add(DR1["TODAYDATE"].ToString());
}
}
else
{
MessageBox.Show("No Data Present In The Database");
}
DR1.Close();
TypeHereTextBox.AutoCompleteMode = AutoCompleteMode.SuggestAppend;
TypeHereTextBox.AutoCompleteSource = AutoCompleteSource.CustomSource;
TypeHereTextBox.AutoCompleteCustomSource = ACSCVV;

Sanjeeb LenkaRank #301 · 8.3K reputationPosted Aug 12, 2013, 9:47 PM EDT
you can try this query
Select to_char(TODAYDATE, 'dd-mm-yyyy') as TODAYDATE from TABLENAME
kumartyr47 reputationPosted Aug 12, 2013, 10:18 PM EDT
Iftikar HussainRank #423 · 5.9K reputationPosted Aug 12, 2013, 10:24 PM EDT
AutoComplete works only with string datatype. So you need to treat your date value as string while typing the value in the textbox. As you said time is not required then do like this
OLCMND3 = new OracleCommand("Select to_char(TODAYDATE, 'dd-mm-yyyy') as DateData from TABLENAME order by NUMBER asc", CON);
Regards,
Iftikar