data binding with no data returned? How can this be handled?

K

Kostia

Basically doing:
<asp:label id=label runat="server" Text='<%# DataBinder.Eval(dsData,
"Tables[Table1].DefaultView.[0].NumNotOK") %>'></asp:label>

if SQL returns 0 rows no data, this throws an exception ("Index 0 is
not non-negative and below total rows count. ") and rightly so of
course, but how should this be handled on the page itself?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,743
Messages
2,569,478
Members
44,898
Latest member
BlairH7607

Latest Threads

Top