_Command = New SqlClient.SqlCommand
_TimeOneDataSet = New TimeOneDataSet
_Connection = New SqlClient.SqlConnection(ConnectionString)
_Command.CommandText = "sp_reports"
_Command.CommandType = CommandType.StoredProcedure
_Command.Connection = _Connection
_Command.Parameters.AddWithValue("@EmployeeID", EmployeeID1)
_Command.Parameters.AddWithValue("@EmployeeID2", EmployeeID2)
_Command.Parameters.AddWithValue("@RecordDate1", RecordDate1)
_Command.Parameters.AddWithValue("@RecordDate2", RecordDate2)
_Connection.Open()
_dataAdapter = New SqlClient.SqlDataAdapter()
_CommandBuilder = New SqlClient.SqlCommandBuilder(_dataAdapter)
_dataAdapter.SelectCommand = _Command
_dataAdapter.Fill(_TimeOneDataSet)
_ReportTotalTime = New ReportDocument
_ReportTotalTime.Load(ReportPath)
_ReportTotalTime.SetDataSource(_TimeOneDataSet)
CrystalReportViewer1.ReportSource = _ReportTotalTime
|