ReportDocument cryRpt = new ReportDocument(); Connection obj = new Connection(); obj.getconn(); SqlCommand cmd3 = new SqlCommand(); cmd3.Connection = obj.con; cmd3.CommandText = "SELQuotationbtdates"; cmd3.CommandType = CommandType.StoredProcedure; DateTime dte = new DateTime(); dte = Convert.ToDateTime(dateTimePicker1.Text); string formatted1 = dte.ToString("dd-MM-yyyy"); cmd3.Parameters.AddWithValue("@todate", formatted1); SqlDataAdapter ds3 = new SqlDataAdapter(cmd3); ds3.Fill(dst); cryRpt.Load("C:/Users/User/Desktop/test1/WindowsFormsApplication1/CrystalReport1.rpt"); cryRpt.SetDataSource(dst); crystalReportViewer1.ReportSource = cryRpt;
CREATE PROCEDURE SELQuotationbtdates @toDate DATETIME AS BEGIN SELECT * FROM Table1 WHERE DateField <=@toDate END
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)