Note that there are some explanatory texts on larger screens.

plurals
  1. POCreating a list of products from a remote SQL database
    text
    copied!<h2>Problem:</h2> <p>I'm new to ASP.Net and I need some guidelines where to start, and what to do? I have read couple of the articles I found on different sites. But, some are not using VB code and I'm not confident of my C# coding knowledge.</p> <p>I have included a table from my database and a PHP code to help visualize what I wanted to create.</p> <h2>My Table</h2> <pre><code> ------------------------------------------------------------------------------------------ | items_id | items_name | items_description | items_price | items_quantity | ------------------------------------------------------------------------------------------ | 1 | Spoon | Shiny and Silver | 50 | 20 | | 2 | Fork | Shiny and Silver | 50 | 20 | | 3 | China | Clean and Polished | 90 | 20 | ------------------------------------------------------------------------------------------ </code></pre> <h2>PHP Code</h2> <pre><code> $sql = mysql_query("SELECT * FROM tbl_items"); $productCount = mysql_num_rows($sql); if ($productCount &gt; 0) { while($row = mysql_fetch_array($sql)){ $id = $row["items"]; $name = $row["items_name"]; $description = $row["items_description"]; $price = $row["items_price"]; $quantity = $row["items_quantity"]; $check_pic = 'venues/'.$id.'/'.$id.'.jpg'; if (file_exists($check_pic)) { $img_src = 'venues/'.$id.'/'.$id.'.jpg'; } else { $img_src = 'venues/0/0.jpg'; } $dynamicList .= '&lt;li class="span3"&gt; &lt;div class="thumbnail"&gt; &lt;p&gt;&lt;b&gt;'.$name. '&lt;/b&gt;&lt;/p&gt;&lt;br /&gt; &lt;img src="'.$img_src.'" alt="" style="box-shadow: 0 2px 3px rgba(0,0,0,0.2);"&gt; &lt;div class="caption"&gt; &lt;p align="center" class="lead" style="color:#053750;"&gt; '.$venue.'&lt;/p&gt; &lt;hr /&gt; &lt;p&gt;&lt;b&gt;Description: &lt;/b&gt; '.$description. '&lt;/p&gt;&lt;br /&gt; &lt;p&gt;&lt;b&gt;Price: &lt;/b&gt; '.$price. '&lt;/p&gt;&lt;br /&gt; &lt;p&gt;&lt;b&gt;Quantity: &lt;/b&gt; '.$quantity. '&lt;/p&gt;&lt;br /&gt; &lt;p&gt;&lt;a href="items_details.php?items_id='.$id.'" class="btn btn-info btn-block"&gt;Choose&lt;/a&gt; &lt;/p&gt; &lt;/div&gt; &lt;/div&gt; &lt;/li&gt;'; } </code></pre> <p><h3>Some articles I have read:</h3><br /> <a href="http://www.asp.net/web-forms/tutorials/tailspin-spyworks/tailspin-spyworks-part-4" rel="nofollow noreferrer">Part 4: Listing Products</a> - The ASP parts are very comprehensible but, I don't know how to replace it's connection to the database to ODBC.</p> <p><a href="https://stackoverflow.com/questions/674204/binding-a-generic-list-to-a-repeater-asp-net">Binding a generic list to a repeater - ASP.NET</a> - The behind codes are C# and I'm having a hard time converting even with the help of C# to VB converter</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload