Guarda questo esempio
codice:<%@ Page Language="VB" %> <%@ Import Namespace="l=libreria.ModuloWeb" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <script runat="server"> Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Dim sb As New StringBuilder() Using reader As OleDbDataReader = msole.GetDataReader(gl.StringaConnessioneTest, "select immagine from campi") Do While (reader.Read) Dim o As Object = reader("immagine") If o IsNot DBNull.Value Then sb.Append(String.Format("[img][/img] ", o.ToString)) Else sb.Append(String.Format("<div>Nessuna immagine</div> ")) End If Loop End Using Me.Literal1.Text=sb.ToString End Sub </script> <html xmlns="http://www.w3.org/1999/xhtml"> <head runat="server"> <title></title> </head> <body> <form id="form1" runat="server"> <div> <asp:Literal ID="Literal1" runat="server" EnableViewState="false"></asp:Literal> </div> </form> </body> </html>

Rispondi quotando