C# 3.0 offers very powerful syntax that allows you to interact with the database in a way that is both natural and safe (using parameterized queries). Your query in C# with LINQ2SQL would look like:
var query = from t in context.table
where t.user_id > 2
select t;
You'd probably use a Repeater in your view so you could just provide your query as the datasource (there are ways to do this in mark up, too) in your codebehind.
// use ToList so context can be disposed
nameRepeater.DataSource = query.ToList();
Your mark up would look like:
<asp:Repeater runat="server" ID="nameRepeater">
<ItemTemplate>
username is:
<asp:Label runat="server"
ID="nameLabel"
Text='<%= Bind("username") %>' />
<br />
</asp:Repeater>
(lines split for readability)
Or you could use ASP.NET MVC in which case the selection code would be in your controller and you could use something more like your PHP-syntax in a strongly-typed view.
<% foreach (Table t in ViewData.Model) { %>
username is: <%= t.username %><br/>
<% } %>