<pre> private void button1_Click(object sender, EventArgs e) { if (TxtCustomer.Text == "" && TxtSONofrom.Text == "" && TxtSONoto.Text == "" && DTSODateFrom.Text != "" && DTSODateTO.Text != "") { if (MessageBox.Show("Do You Want to Print This Report?", "YESNO", MessageBoxButtons.YesNo) == DialogResult.Yes) { BrownERP.ReportViewer cr = new BrownERP.ReportViewer(); cr.BringToFront(); cr.Show(); BrownERP.QuatationReport QTNREP = new BrownERP.QuatationReport(); SqlConnection con = new SqlConnection(connectionpath); con.Open(); SqlCommand cmd = new SqlCommand("select * from Tbl_QTN where SODate between CONVERT(DATETIME,'" + DTSODateFrom.Text + "',103) and CONVERT(DATETIME,'" + DTSODateTO.Text + "',103) ", con); SqlDataAdapter sda = new SqlDataAdapter(cmd); DataSet ds = new DataSet(); sda.Fill(ds, "Tbl_QTN"); QTNREP.SetDataSource(ds); cr.CRV.ReportSource = QTNREP; cr.CRV.Refresh(); con.Close(); } else { this.Close(); } } }
SqlCommand cmd = new SqlCommand("select * from Tbl_QTN where SODate between CONVERT(DATETIME,'" + DTSODateFrom.Text + "',103) and CONVERT(DATETIME,'" + DTSODateTO.Text + "',103) ", con);
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)