questo è un esempio
codice:
<%@ Page Language="VB" AutoEventWireup="false" CodeFile="a.aspx.vb" Inherits="prove_a" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
<style type="text/css">
body
{
font-family: Verdana, Helvetica, sans-serif;
font-size: 10pt;
}
li
{
list-style-type: none;
}
</style>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:Literal ID="Literal1" runat="server" EnableViewState="false"></asp:Literal>
</div>
</form>
</body>
</html>
codice:
Option Strict On
Imports l = libreria.ModuloWeb
Partial Class prove_a
Inherits System.Web.UI.Page
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
Dim sb As New StringBuilder()
Using rd As OleDbDataReader = msole.GetDataReader(gl.StringaConnessione, "select nome_regione from regioni where 1=1 ")
If rd.HasRows Then
sb.Append("<ul>")
Do While (rd.Read)
sb.Append("[*]")
sb.Append(rd("nome_regione").ToString)
sb.Append("")
Loop
sb.Append("[/list]")
Else
sb.Append("Non ci sono dati")
End If
End Using
Me.Literal1.Text = sb.ToString
End Sub
End Class