Checking If Query Returns Data in ASP.NET Web PAges

If you are executing a query against a database, you need to know if the data has returned anything. There are many ways to test for the presence of data in an ASP.NET Web Page but only one method is the most optimal way to do it – using the Web Pages Database Helper.

First, you need to understand various Database Helper methods and what they return is required. The principal methods are:

Execute: returns int.
QueryValue returns Object.
QuerySingle returns Object
Query returns IEnumberable<Object>

For additional information visit the MSDN website.

After that, follow this tutorial:


Leave a Reply

Your email address will not be published. Required fields are marked *