Example #1
0
        public ConsoleDataSet.JobStep_RecordsDataTable GetIdRange(int firstId, int lastId)
        {
            ConsoleDataSet.JobStep_RecordsDataTable jsTable = new ConsoleDataSet.JobStep_RecordsDataTable();
            sqlSELECTbyID.Parameters["@FirstID"].Value = firstId;
            sqlSELECTbyID.Parameters["@LastID"].Value  = lastId;
            try
            {
                System.Threading.Monitor.Enter(sqlConnection1);                //Lock the sqlconnection
                if (sqlConnection1.State == ConnectionState.Closed)
                {
                    sqlConnection1.Open();
                }
                sqlDataAdapter1.SelectCommand = sqlSELECTbyID;
                sqlDataAdapter1.Fill(jsTable);
                sqlDataAdapter1.SelectCommand = sqlSelectCommand1;
            }
            finally
            {
                if (sqlConnection1.State != ConnectionState.Closed)
                {
                    sqlConnection1.Close();
                }
                System.Threading.Monitor.Exit(sqlConnection1);                //Unlock the sqlconnection
            }

            return(jsTable);
        }
        /// <summary>
        ///
        /// </summary>
        /// <param name="start"></param>
        /// <param name="end"></param>
        /// <returns></returns>
        public override DataTable GetData(int start, int end)
        {
            ConsoleDataSet.JobStep_RecordsDataTable table = null;
            try
            {
                table = (ConsoleDataSet.JobStep_RecordsDataTable)((ManJobStepRecs)manager).GetIdRange(start, end);
            }
            catch (System.Data.SqlClient.SqlException sqle)
            {
                Debug.WriteLine("SQL Exception - " + sqle.Message);
                Status = new StatusEventArgs(635, StatusEventArgs.SEVERE, sqle.Message);
            }

            return(table);
        }