예제 #1
0
        public ActionResult Partners()
        {
            Images p = new Images();
            List<Images> Li = new List<Images>();

            Li = p.IndexDisplay();
            ViewData["IndexDisplay"] = Li;
            return View(Li);
        }
예제 #2
0
        public List<Images> IndexDisplay()
        {
            SqlConnection con = new SqlConnection(constr);
            con.Open();

            using (con)
            {
                SqlCommand cmd = new SqlCommand("Select * from ImageTable ",con);
                SqlDataReader rd = cmd.ExecuteReader();

                while (rd.Read())
                {
                    p = new Images();
                    p.Name = Convert.ToString(rd.GetSqlValue(1));
                    p.Image1  = (byte[])rd[2];
                    ImagesList.Add(p);

                }
            }

            return ImagesList;
        }