G
Guest
Hi
I have a datagrid populated from a dataadapter that is databound when the user picks a choice from a dropdownlist
Depending on the choice, the user queries the database and may get considerable amount of rows returned. But then again, no rows may be returned at all - because of the parameter the user has chosen
I want to check the number of rows in the dataadapter before I bind it to the datagrid. If the query returns no rows, no datagrid is displayed. Now I am having an empty datagrid displayed in this case, I do not want it to show at all
I know about the HasRows property, but it only seems to apply to the datareader. As I want to page the datagrid (the number of rows may be up to 300 returned), I think I cannot use it, can I
Is there any way of doing this, without changing my code
Any help would be much appreciated
Kaspian
I have a datagrid populated from a dataadapter that is databound when the user picks a choice from a dropdownlist
Depending on the choice, the user queries the database and may get considerable amount of rows returned. But then again, no rows may be returned at all - because of the parameter the user has chosen
I want to check the number of rows in the dataadapter before I bind it to the datagrid. If the query returns no rows, no datagrid is displayed. Now I am having an empty datagrid displayed in this case, I do not want it to show at all
I know about the HasRows property, but it only seems to apply to the datareader. As I want to page the datagrid (the number of rows may be up to 300 returned), I think I cannot use it, can I
Is there any way of doing this, without changing my code
Any help would be much appreciated
Kaspian