hello I have a code that pulls the data to the gridview using a dataset, what is the best way to check if the Gridview is empty and if it is to not throw an error.. Right now my gridview has the setting to show a message if its empty.. but I just want to null and empty check after attempting to get the data in the dataset
Students students = new Students();
DataSet studentsList = students.GetAllStudents();
GridView1.DataSource = studentsList;
GridView1.DataBind();
If I understand your question correctly, why not just check if the DataSet is empty, before you bind it to the GridView?
If it is, just don’t bind it.