Quantcast
Channel: Visual C# forum
Viewing all articles
Browse latest Browse all 31927

searching of data within the date in date time picker

$
0
0

void FillCombo() //link data to dropdown list
        {
            string ConnectionString =
                "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=" + _excelFilePath + ";Extended Properties=\"Excel 8.0;HDR=YES;\"";
            //connection to read excel file ,file path
            OleDbConnection conn = new OleDbConnection(ConnectionString);
            string strCmd = "select DISTINCT [Course Title] from [Sheet1$I1:I886]";//drop down list values
            OleDbCommand Cmd = new OleDbCommand(strCmd, conn);

            try
            {
                conn.Open();
                adapter.SelectCommand = Cmd;
                DataSet dtSet = new DataSet();
                adapter.Fill(dtSet);
                for (int i = 0; i < dtSet.Tables[0].Rows.Count; i++)
                {
                    data = (String)dtSet.Tables[0].Rows[i].ItemArray[0];
                    comboBox1.Items.Add(new Item(data, data));
                }

                comboBox1.SelectedIndex = -1;
                MessageBox.Show("Please Key in your searched word", "Error!");
            }

            catch (Exception ex)
            {
                MessageBox.Show(ex.ToString(),"Your Searched Word Can't Be Found");

            }
        }

How do I start a condition so when I search my data , the data will fall within the date shown in the date time picker ?

                


Viewing all articles
Browse latest Browse all 31927

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>