Dim rpttitle As String = "All Data Of Employee" Dim rptcomment As String con = New SqlConnection("Data Source=192.168.101.102;Initial Catalog=test_data;Persist Security Info=True;User ID=wml;Password=win") con.Open() 'cmd = New SqlCommand("select * from test where dt ='" & Format(CType(DateTimePicker1.Text, Date), "MM/dd/yyyy") & "' , con) 'cmd.ExecuteNonQuery() adpt = New SqlDataAdapter("select * from test where dt between'" & Format(CType(DateTimePicker1.Text, Date), "MM/dd/yyyy") & "'and '" & Format(CType(DateTimePicker2.Text, Date), "MM/dd/yyyy") & "' order by dt", con) ds = New Data.DataSet adpt.Fill(ds) If ds.Tables(0).Rows.Count > 0 Then Dim strRptName As String = "D:\Dipak Nakum\Fil_Pipe_Calculator\Fil_Pipe_Calculator\WindowsApplication1\reports\Report1.rpt" rptcomment = "Date Between " & Format(CType(DateTimePicker1.Text, Date), "dd/MM/yyyy") & " And " & Format(CType(DateTimePicker2.Text, Date), "dd/MM/yyyy") rpt.Load(strRptName) rpt.SetDatabaseLogon("wml", "win") rpt.SetDataSource(ds.Tables(0)) rpt.SummaryInfo.ReportTitle = rpttitle rpt.SummaryInfo.ReportComments = rptcomment CrystalReportViewer1.ReportSource = rpt
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)