winforms - rdlc report not showing latest inserted data c# -
i trying show report on same form when user clicks on button insert record in database.
here's situation: below code, data shows when write code on separate form.
private void invoice_load(object sender, eventargs e) { con.open(); sqlcommand cmd = new sqlcommand( "select top 1 invoiceid sale order date desc", con); sqldatareader dr = cmd.executereader(); if (dr.read()) { int invoiceid = int.parse(dr[0].tostring()); this.saletableadapter.fill(this.estoredbdataset.sale,invoiceid); } this.reportviewer1.refreshreport(); }
however, it's not showing when code in if
statement below:
{ //insert record code this.saletableadapter.fill(this.estoredbdataset.sale,invoiceid); this.reportviewer1.refreshreport(); }
Comments
Post a Comment