473,379 Members | 1,220 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,379 software developers and data experts.

Repeater syntax question

I have a stored procedure that returns a select with a variable number of
columns based on the data. By reading the number of columns returned, I
construct a stringbuilder with the html tags for a table with the
appropriate headings, body data and footer. I can response.write the
results which works fine but since I'd like to position the information on
the page, the repeater control seems to make the most sense. I've bound the
repeater to the datareader source but would like to set the header, item and
footer templates with the stringbuilder value at the appropriate points in
the code. How do I get the stringbuilder into the templates?

Here's a snipet of code

With sbHeader

..Append("<table width=""100%"" border=""0"" cellspacing=""1""
cellpadding=""3"" bgcolor=""#CCCCCC"">")

..Append("<tr><td bgcolor=""#FFFFFF"">")

..Append("</td><td bgcolor=""#FFFFFF"" align=""Left"">")

..Append("<font face=""Arial, Helvetica, sans-serif""
size=""1"">&nbsp;Customer ID<br>Customer Name<br>UPS Tracking
ID</font></td>")

For i = 6 To dr.FieldCount - 1

..Append("<td bgcolor=""#FFFFFF"" align=""center""><font face=""Arial,
Helvetica, sans-serif"" size=""1"">")

..Append(Replace(dr.GetName(i).ToString, "_", "<br>") & "</font></td>")

i = i + 1

Next i

..Append("<td bgcolor=""#FFFFFF"" align=""center""><font face=""Arial,
Helvetica, sans-serif"" size=""1"">Weight Total</font></td></tr>")

' Obviously this doesn't work but what does? Repeater1.HeaderTemplate =
sbHeader.toString

End With

Many Thanks

Kevin Vogler
Nov 17 '05 #1
0 826

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Gastin | last post by:
I am digesting a web serivce from Amazon.Com. I have the following class which was autogenerated by VS.NET when I created a Web Reference to...
2
by: Donald Williamson | last post by:
I have a DataReader that I am binding to a Repeater control. In the DataReader, I have two fields: 'Name1' and 'Name2' 'Name1' will always have a person's name. Name2 periodically has a person's...
2
by: Gastin | last post by:
I am consuming a web serivce from Amazon.Com. I have the following class which was autogenerated by VS.NET when I created a Web Reference to...
3
by: Leigh Webber | last post by:
I have an HTMLAnchor control on my aspx page. When it's not inside a repeater, it works fine. When I put it inside a repeater control, the handler never gets fired. I have a handler for the...
4
by: John Kotuby | last post by:
Hi all, I am using a Repeater in conjunction with a SQLDatasource and SQL Server. One of the controls in the repeater is a HyperlLink as follows: <asp:HyperLink...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.