Repeater with inline BLOB

Employees ProfilePhoto
2NameDr. Andrew Fuller
Reports To
TitleVice President, Sales
Birthdate2/19/1952 12:00:00 AM
HireDate8/14/1992 12:00:00 AM
Address908 W. Capital Way - Tacoma - WA. 98401 USA
Phone(206) 555-9482 x 3457
Notes
3NameMs. Janet Leverling
Reports ToAndrew Fuller
TitleSales Representative
Birthdate8/30/1963 12:00:00 AM
HireDate4/1/1992 12:00:00 AM
Address722 Moss Bay Blvd. - Kirkland - WA. 98033 USA
Phone(206) 555-3412 x 3355
Notes
4NameMrs. Margaret Peacock
Reports ToAndrew Fuller
TitleSales Representative
Birthdate9/19/1958 12:00:00 AM
HireDate5/3/1993 12:00:00 AM
Address4110 Old Redmond Rd. - Redmond - WA. 98052 USA
Phone(206) 555-8122 x 5176
Notes
5NameMr. Steven Buchanan
Reports ToAndrew Fuller
TitleSales Manager
Birthdate3/4/1955 12:00:00 AM
HireDate10/17/1993 12:00:00 AM
Address14 Garrett Hill - London - . SW1 8JR UK
Phone(71) 555-4848 x 3453
Notes
6NameMr. Michael Suyama
Reports ToSteven Buchanan
TitleSales Representative
Birthdate7/2/1963 12:00:00 AM
HireDate10/17/1993 12:00:00 AM
AddressCoventry House Miner Rd. - London - . EC2 7JR UK
Phone(71) 555-7773 x 428
Notes

bottom next goreload

[1 - 5 : 8]

Data Repeater with BLOB
<script language="VB" runat="server">
Sub Page_Load(Src As Object, E As EventArgs)
'------------- Repeater Template -------------------
Dim fm as string="<TABLE border='0' cellpadding='2' cellspacing='0' width='100%'><TR><TD align=right>"
fm=fm & "<TD class='ch'>!EmployeeID!</TD>"
fm=fm & "<TD align=right class='gh'><B>Name</B></TD>"
fm=fm & "<TD class='ch'>!TitleOfCourtesy! "
fm=fm & "!FirstName! !LastName!</TD></TR>"
fm=fm & "<TR><TD align=right class='fl'><b>"
fm=fm & "Reports To</b></TD><TD COLSPAN=3 class='r2'>"
fm=fm & "!ReportsTo!</TD></TR>"
fm=fm & "<TR><TD align=right class='fl'><B>Title</B></TD>"
fm=fm & "<TD COLSPAN=3 class='r1'>"
fm=fm & "!Title!</TD></TR>"
fm=fm & "<TR><TD align=right class='fl'><b>"
fm=fm & "Birthdate</b></TD>"
fm=fm & "<TD colspan='3' class='r2'>"
fm=fm & "!Birthdate!</TD></TR>"
fm=fm & "<TR><td align=right class='fl'><b>"
fm=fm & "HireDate</b></TD><td colspan='3' class='r1'>"
fm=fm & "!Hiredate!</TD></TR>"
fm=fm & "<TR><TD align=right class='fl'><B>Address</B></TD>"
fm=fm & "<TD COLSPAN=3 class='r2'>!Address! - !City! - !Region!. !PostalCode! !Country!</TD></TR>"
fm=fm & "<TR><TD align=right class='fl'><B>Phone</B></TD>"
fm=fm & "<TD COLSPAN=3 class='r1'>!HomePhone! x !Extension!</TD></TR>"
fm=fm & "<TR><TD align=right class='flf'><B>Notes</B></TD><TD COLSPAN=3>"
fm=fm & "<TEXTAREA COLS=50 ROWS=6>!Notes!</TEXTAREA></TD></TR>"
fm=fm & "</TABLE>"


'---- ASPdb.Net Code ----
  Dim ACC As New Tornado.Z()
  With ACC
    .dbQP="U=9| Q=Employees| D=NewNwind.mdb| M=G| Gdf=0,Photo| Mts=-1| Th=Tit=Repeater with inline BLOB| BM=employees;0"
    .dbSkin = "type=Watch"
    .dbNameMap="field=0|alias=Employees Profile"
    .dbCommonTables="index=EID,FULLNAME|sql=SELECT EmployeeID, FirstName & ' ' & Lastname as Name FROM Employees"
    .dbLookUpFLds="fi=ReportsTo|key=EID|look=FullName"
    .dbGridMagicCell="(;,[]!|~/)field=0|macro=" & fm
    .dbBlob = "fi=Photo|co=image/bmp|la=browser|off=78"
    .ASPdbNet
  End With
End Sub
</script>
We'll add an Inline image BLOB to the repeater by just adding the additional properties in blue. That all it takes, try to view this example using  browsers that supports BMP image file format. If the BLOB is a .gif format, then it work for all.

Note: The Photo field contains the image BLOB in BMP format. BLOB offset for BMP file is 78 and 0 for GIF format.


Send comments on this topic.
Copyright (c) 1998-2006 ASP-db