// Load dataset to datagridview public void LoadDataTodo() { // Fetch dataset DataSet todoDS = DBGetData.GetTodoDGVActive(); if (todoDS != null) { // No tables fetched if (todoDS.Tables.Count == 0) { new StatusMessage("No datatable found, contact administrator."); return; } // No rows fetched else if (todoDS.Tables[0].Rows.Count == 0) { new StatusMessage("No datarows found in todo."); return; } // Clear labelStatus for previous messages else { new StatusMessage(""); } // Set the dataset as source for datagridview and make sure its displayed dataGridViewTodo.DataSource = todoDS; dataGridViewTodo.DataMember = "Get_Todo_Active"; LoadDataGridViewTodo(); } }