Hi sir,
I am using ASP.NET datalist control and I want to display "No Data Found" message when query return 0 rows from database.
Please give me the code for that...
thanks Regards
Jahi
Loading
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Abhimanyu K VatsaPosted May 9, 2011, 3:55 AM
1st way:-
2nd way:-
<asp:DataList
id="dlstBooks"
DataSourceID="SqlDataSource1"
UseAccessibleHeader="true"
CssClass="books"
HeaderStyle-CssClass="header"
ItemStyle-CssClass="item"
AlternatingItemStyle-CssClass="alternating"
Runat="server">
<HeaderTemplate>
Book List
HeaderTemplate>
<ItemTemplate>
<%#Eval("NAME")%>
ItemTemplate>
<FooterTemplate>
Total Record = <%# DataList1.Items.Count %>
FooterTemplate>
asp:DataList>
<asp:SqlDataSource ID="SqlDataSource1" runat="server"
ConnectionString="<%$ ConnectionStrings:DatabaseConnectionString1 %>"
ProviderName="<%$ ConnectionStrings:DatabaseConnectionString1.ProviderName %>"
SelectCommand="SELECT [NAME] FROM [BOOKS]">
asp:SqlDataSource>
jaheena jamalPosted May 10, 2011, 2:50 AM
Thanks alot. My prblm solved
Thanks regards
Jahi
Abhimanyu K VatsaPosted May 9, 2011, 3:56 AM
http://www.vbdotnetheaven.com/UploadFile/abhikumarvatsa/2621/