c# - Using DateTimePicker to specify my ReportViewer in MS Access -


so use datetimepicker parameter display specific dates database, report generating dates based on today, though i've tried using other dates. please help, stuck.

private void button1_click(object sender, eventargs e)     {        datatable dt = new datatable();         try         {             oledbcommand com = new oledbcommand();             oledbdataadapter adapter = new oledbdataadapter();             connection.open();             com.connection = connection;              if (true)             {                 com.commandtext = string.format("select customer.cid, customer.firstname, customer.lastname, customer.mobilecontactnumber, booking.vehiclenumber, customer.membertype, customer.points, booking.[date], booking.[time] (booking inner join customer on booking.cid = customer.cid) booking.[date] = ' "+datetimepicker1.value+"'");                 adapter.selectcommand = com;                 adapter.fill(dt);             }              this.datatable1tableadapter.fill(this.reportxsd.datatable1);             this.reportviewer1.refreshreport();             connection.close();         }          catch (exception ex)         {             throw ex;         }      } 


Comments

Popular posts from this blog

ios - RestKit 0.20 — CoreData: error: Failed to call designated initializer on NSManagedObject class (again) -

java - Digest auth with Spring Security using javaconfig -

laravel - PDOException in Connector.php line 55: SQLSTATE[HY000] [1045] Access denied for user 'root'@'localhost' (using password: YES) -