Exemplo n.º 1
0
        public static void ExecuteSP(out List<Moneda> LMoneda,String commandText, SqlParameter[] Parametros, bool ConGenericos)
        {
            SqlConnection dc = new System.Data.SqlClient.SqlConnection(ConfigurationManager.ConnectionStrings["EbuyConexion"].ConnectionString); //"Database=EplaceDb;Server=10.20.20.200;User Id=executor;Password=executor;");
            try
            {
                List<Moneda> list = new List<Moneda>();
                Moneda item = new Moneda();

                SqlCommand command = new SqlCommand();

                command = getEbuy(commandText, Parametros, ConGenericos);
                command.Connection = dc;
                dc.Open();

                IDataReader lector = command.ExecuteReader();

                while (lector.Read())
                {
                    list.Add(item.castDR(lector));
                }

                lector.Close();
                LMoneda= list;
            }
            catch (Exception ex)
            {

                throw new Exception(ex.Message);
            }
        }