Hi,
i am making a bill application in window form C# .i take two data set and drag and drop two tables for printing data on report view.then i create a report and bind data with these data set then after new Form and drag and drop report viewer control.when i run this application on clicking submit button current bill's data inserted into data base.and i want to print this last bill id's detail on report.![enter image description here][1]
when i click on submit button this bill no's all detail inserted into data base properly.
Code of save and print button in c#:
private void button3_Click_1(object sender, EventArgs e)
{
this.Close();
Form2 f2 = new Form2();
f2.Show();
}
after clicking save and print below form open.![enter image description here][2].
Code of Button click :
private void button1_Click(object sender, EventArgs e)
{
da = new SqlDataAdapter("select billId from Bill_Detail order by billId DESC", cn);
DataSet ds = new DataSet();
da.Fill(ds);
int id = Convert.ToInt32(ds.Tables[0].Rows[0][0].ToString());
textBox1.Text = id.ToString();
this.Customer_detailTableAdapter.Fill(this.DataSet1.Customer_detail, Convert.ToInt32(textBox1.Text));
this.Bill_DetailTableAdapter.Fill(this.DataSet2.Bill_Detail, Convert.ToInt32(textBox1.Text));
reportViewer1.LocalReport.Refresh();
this.reportViewer1.RefreshReport();
}
i have tried but it not works.how can i get current Bill no's detail in report viewer?