I have a data grid, bound to one field. when I do the sql statement,
I get no rows back. what I would like to do, is display a friendly message
"N/A" when this occurs.
below is the data grid definition.
in the sql statement, I did a retrieval with isnull(field,"N/A") on that
field. only the header is displayed, no data. I am using sql reader to
perform the retrieval. if you need more info, please ask.
any help on solving this problem would be appreciated.
<asp:DataGrid id="dgrd_appt" runat="server" AutoGenerateColumns="false"
BackColor="white" CellPadding="2" CellSpacing="0" BorderStyle="solid"
BorderColor="black" BorderWidth="1" font-size="x-small" GridLines="Both"
font-names="verdana" PageSize="4">
<AlternatingItemStyle
BackColor="palegoldenrod" />
<ItemStyle BackColor="beige"
VerticalAlign="top" />
<EditItemStyle BackColor="yellow" Font-
Bold="true" />
<HeaderStyle ForeColor="white"
BackColor="brown" HorizontalAlign="center" Font-Bold="true" />
<columns>
<asp:TemplateColumn runat="server"
HeaderText="Today's Appointment">
<itemtemplate>
<asp:label
runat="server" width="50" text='<%# DataBinder.Eval
(Container.DataItem,"activityType_description")%>' visible = "True"
ID="Label2"/>
</itemtemplate>
</asp:TemplateColumn>
</columns>
</asp:DataGrid>
You can read messages from the Advanced DOTNET archive, unsubscribe from Advanced
DOTNET, or
subscribe to other DevelopMentor lists at http://discuss.develop.com.