locked
Getting Images from SqlServer Ce (for each photo) RRS feed

  • Question

  • User1935446700 posted
    @{
        
    }
    
    <div class="gallery">
    <img src="image path from database" alt="..." />
    <!-- Image loop -->
    </div>

    Actually looks like this;

    Monday, October 26, 2015 6:28 PM

Answers

All replies

  • User1935446700 posted

    But these resources are viewing the picture temporarily.

    Tuesday, October 27, 2015 3:57 AM
  • User325035487 posted

    What else do you want it to do?

    Tuesday, October 27, 2015 11:03 AM
  • User1935446700 posted

    Eureka!

    @{
        Page.Title = "Home";
    
        var db = Database.Open("Company");
        var products = db.Query("SELECT * FROM PRODUCTS").ToList();
        var featured = products[new Random().Next(products.Count)];
    }
    
    
    <div class="container-fluid">
                        <div class="row no-gutter">
                            <ul class="products" id="products" data-role="listview" data-inset="true">
                                @foreach (var p in products) {
                                    <li class="col-lg-2 col-sm-6">
                                        <a href="~/detail/@p.Id" class="product-box" target="_blank">
                                            <img src="~/Images/Products/Thumbnails/@p.ImageName" class="img-responsive"  alt="Image of @p.Name"/>
                                            <div class="product-box-caption">
                                                <div class="product-box-caption-content">                                                
                                                    <div class="product-name">
                                                        @p.Name
                                                    </div>
                                                </div>
                                            </div>
                                        </a>
                                    </li>       
                                }                                                 
                            </ul>
                        </div>
    </div>

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Wednesday, October 28, 2015 4:22 AM