Want to avoid code like this (this is VB.net code I wolud love to see
the C# code it is probably almost identical):

BEFORE:

<%# 
dtbndCityStateZipCombo(Container.DataItem("city"),Container.DataItem("state"),Container.DataItem("zip"))
%>

Function dtbndStateZipCombo(p1 as string,p2 as string, p3 as string) as string
       Return p1 & "&nbsp;&nbsp;&nbsp;" & p2 & "<b>" & p3 & "</b>
End Function


and BTW This code gets theres times as long and ugly if nulls may be
in data. And even longer for every field.

Then do this and access all fields in one step:

AFTER!!!!!!


<%# dtbndCityStateZipCombo(Container.DataItem) %>

Function dtbndStateZipCombo(p1 as dbDataRecord) as string
      return(p1.item("city") & "&nbsp;&nbsp;" & p2 .item("state") &
"&nbsp;<b>" & p1.item("zip") & "</b>")
End Function


or do this

THE BEST AFTER!!!!!!

Function dtbndStateZipCombo(p1 as dbDataRecord) as string
     Dim sbTemp as new stringbuilder
     Dim strSpacer as string="&nbsp;&nbsp;"
    with sbTemp
        .append(p1.item("city"))
        .append(strSpacer)
        .append(p1.item("state"))
        .append(strSpacer)
        .append("<b>" & p1.item("zip") & strSpacer)
    end with
    return (sbTemp.ToString())
end function


------------------------ Yahoo! Groups Sponsor --------------------~--> 
Most low income households are not online. Help bridge the digital divide today!
http://us.click.yahoo.com/I258zB/QnQLAA/TtwFAA/saFolB/TM
--------------------------------------------------------------------~-> 

 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/AspNetAnyQuestionIsOk/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 



Reply via email to