예제 #1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            ConectionDB conection = new ConectionDB();

            conection.ConnectDB();
            try
            {
                //Declaro mi SqlCommand
                var fill = "SELECT [idCategoria],[descripcion] FROM [dbo].[Categoria]";

                cate.DataSource = conection.GetData(fill);
                cate.DataBind();
                conection.CloseDB();
            }
            catch (Exception ex)
            {
                Response.Write(ex.Message);
            }
            conection.CloseDB();
        }