M
Mike Cain
I'm filling a Repeater control based on a SELECT statement. If the SELECT
statement returns 0 rows, then I want to hide the entire Repeater control.
Currently I'm doing this:
SqlCommand cmd = new SqlCommand("SELECT * FROM whatever where whatever",
conn);
myRepeater1.DataSource =
cmd.ExecuteReader(CommandBehavior.CloseConnection);
So what I'm looking for is now to do this:
if (something == true)
myRepeater1.visible = false;
However I cannot figure ouw what the "something" is above in the IF
statement. What could I use there to either determine that the SQL SELECT
statement returned 0 rows or that the Repeater contained no nows so that I
can dynamically hide the entire repeater includng its header and footer?
Thanks!
statement returns 0 rows, then I want to hide the entire Repeater control.
Currently I'm doing this:
SqlCommand cmd = new SqlCommand("SELECT * FROM whatever where whatever",
conn);
myRepeater1.DataSource =
cmd.ExecuteReader(CommandBehavior.CloseConnection);
So what I'm looking for is now to do this:
if (something == true)
myRepeater1.visible = false;
However I cannot figure ouw what the "something" is above in the IF
statement. What could I use there to either determine that the SQL SELECT
statement returned 0 rows or that the Repeater contained no nows so that I
can dynamically hide the entire repeater includng its header and footer?
Thanks!