Exemplo n.º 1
0
        public static DataSet QueryScrapByShipReport(DateTime beginDate, DateTime endDate)
        {
            DataSet dataSet = new CarsMaintenance.Reports.ScrapByShipDataSet();

            using (SqlConnection conn = new SqlConnection(ConfigurationManager.ConnectionStrings[CONNECTION_NAME].ConnectionString))
            {
                try
                {
                    conn.Open();

                    string sql = string.Format(sqlScrapByShip, beginDate, endDate);

                    SqlDataAdapter dataAdapter = new SqlDataAdapter(sql, conn);
                    dataAdapter.Fill(dataSet.Tables[0]);
                }
                //catch (Exception e)
                //{
                //}
                finally
                {
                    conn.Close();
                }
            }
            return(dataSet);
        }
Exemplo n.º 2
0
        public static DataSet QueryScrapByShipReport(DateTime beginDate, DateTime endDate)
        {
            DataSet dataSet = new CarsMaintenance.Reports.ScrapByShipDataSet();
            using (SqlConnection conn = new SqlConnection(ConfigurationManager.ConnectionStrings[CONNECTION_NAME].ConnectionString))
            {
                try
                {

                    conn.Open();

                    string sql =string.Format( sqlScrapByShip,beginDate,endDate);

                    SqlDataAdapter dataAdapter = new SqlDataAdapter(sql, conn);
                    dataAdapter.Fill(dataSet.Tables[0]);
                }
                //catch (Exception e)
                //{
                //}
                finally
                {
                    conn.Close();
                }

            }
            return dataSet;
        }