when selecting a date from datetimepicker, respective data present in database of that particular date should display in datagridview using c#.net windows form??
Hi Everyone,
I'm developing 1 windows application to my own Finance branch office itseems..In this I'm trying to display data's which are stored in database and Exporting that data's into EXCEL as well. I used Datagridview for displaying data's and I can export selected rows into excel as well..
Here my issue is I want to display the rows in datagridview with respect to selecting a date form datetimepicker and I should export only those particular data's into EXCEL Report.. I would like to use Checkboxes in Datagridview for selecting the rows ...I don't know how to achive this..could any 1 help me out...
Amitesh VermaPosted Aug 10, 2015, 3:03 AM
string sql = "SELECT * from table where due_date='"+dateTimePicker1.Value+"'";
SqlConnection connection = new SqlConnection(connectionString);
SqlDataAdapter dataadapter = new SqlDataAdapter(sql, connection);
connection.Open();
dataadapter.Fill(ds, "Titles_table");
connection.Close();
dataGridView1.DataSource = ds.Tables[0];