Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Condition statement using SQL data??

Status
Not open for further replies.

jkl

Programmer
Joined
May 16, 2001
Messages
83
Location
US
I'm using a DataList object to display information from a SQL database to screen. I'm using several "labels" to display address information. I have 1 "label" for each line of the address (4 lines). Not all addresses have 4 lines of info.

How do I do a conditional to check for the existence of data to determine whether or not to show the label? Specifically, id "rsAddr2".

Thanks.

==========================

<asp:label id=&quot;rsAddr1&quot; class=&quot;dbProfile&quot; style=&quot;LEFT: 20px; TOP: 45px&quot; runat=&quot;server&quot; Width=&quot;200px&quot; Height=&quot;21px&quot;><%# DataBinder.Eval(Container.DataItem, &quot;vwAddr1&quot;) %></asp:label>

<asp:label id=&quot;rsAddr2&quot; class=&quot;dbProfile&quot; style=&quot;LEFT: 20px; TOP: 60px&quot; runat=&quot;server&quot; Width=&quot;200px&quot; Height=&quot;21px&quot;><%# DataBinder.Eval(Container.DataItem, &quot;vwAddr2&quot;) %></asp:label>

<asp:label id=&quot;rsCity&quot; class=&quot;dbProfile&quot; style=&quot;LEFT: 20px; TOP: 75px&quot; runat=&quot;server&quot; Width=&quot;200px&quot; Height=&quot;21px&quot;><%# DataBinder.Eval(Container.DataItem, &quot;vwCity&quot;) %>, <%# DataBinder.Eval(Container.DataItem, &quot;vwState&quot;) %>   <%# DataBinder.Eval(Container.DataItem, &quot;vwZip&quot;) %></asp:label>


==========================
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top