data grid question

M

Mike P

I'm binding a data source to a data grid :

objConnection.Open();
dgHistory.DataSource =
objCommand.ExecuteReader(CommandBehavior.CloseConnection);
dgHistory.DataBind();

The question I have is, if the data source is empty how do I test for
this? I want to print to the screen using a label if there is no data
to be displayed.


Any help would be appreciated.


Cheers,

Mike
 
S

Saravana

You can check like this itself.

if isnothing(dghistory.datasource) then
do something
end if
 

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
474,102
Messages
2,570,646
Members
47,247
Latest member
GabrieleL2

Latest Threads

Top