ASP.NET Clear the GridView data on specific condition When there are no data found for user search criteria then we want to clear the previous gridview data and display "No record found" message to user. This can be achieved by following line of code: Set the DataSource = null and bind this to your gridview. if (lblError.Visible == false ) { if (dvCustomerRecords.Count > 0) { gvCustomer.DataSource = dvCustomerRecords; ...
BizTalk/.NET/SQL/SharePoint...and more as par demand