Creating a list of products from a remote SQL database

b3rguinho

New Member
Problem: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.I have included a table from my database and a PHP code to help visualize what I wanted to create.My Table\[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\]PHP Code\[code\] $sql = mysql_query("SELECT * FROM tbl_items"); $productCount = mysql_num_rows($sql); if ($productCount > 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 = 'http://stackoverflow.com/questions/15467581/venues/'.$id.'/'.$id.'.jpg'; } else { $img_src = 'http://stackoverflow.com/questions/15467581/venues/0/0.jpg'; } $dynamicList .= '<li class="span3"> <div class="thumbnail"> <p><b>'.$name. '</b></p><br /> <img src="'.$img_src.'" alt="" style="box-shadow: 0 2px 3px rgba(0,0,0,0.2);"> <div class="caption"> <p align="center" class="lead" style="color:#053750;"> '.$venue.'</p> <hr /> <p><b>Description: </b> '.$description. '</p><br /> <p><b>Price: </b> '.$price. '</p><br /> <p><b>Quantity: </b> '.$quantity. '</p><br /> <p><a href="http://stackoverflow.com/questions/15467581/items_details.php?items_id='.$id.'" class="btn btn-info btn-block">Choose</a> </p> </div> </div> </li>'; }\[/code\]Some articles I have read:
Part 4: Listing Products - The ASP parts are very comprehensible but, I don't know how to replace it's connection to the database to ODBC.Binding a generic list to a repeater - ASP.NET - The behind codes are C# and I'm having a hard time converting even with the help of C# to VB converter
 
Back
Top