Click here to Skip to main content
14,983,791 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
i want to show data in gridview from database only 3 column of 20 column table, database table have 5 null rows of that columns which i want to retrieve, in my grid empty rows are shown.
How can i handle empty rows in gridview.
Posted

1 solution

Your question did not mention how you want to handle the empty rows, but if you want them not to be shown then the best way to do so is in the SQL query used to retrieve the data.
Add a WHERE[^] clause to the SQL query to exclude the NULL[^] rows:
SQL
WHERE column1 IS NOT NULL AND column2 IS NOT NULL and column3 IS NOT NULL and column4 IS NOT NULL and column5 IS NOT NULL
   

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)




CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900