private void ViewStatus(string strStatus) { // SQL Connection SqlConStr strSqlConnection = new SqlConStr(); SqlConnection connection = new SqlConnection(strSqlConnection.GetString() ); DataSet ds = new DataSet(); try { connection.Open(); SqlCommand command = new SqlCommand("spWvGetIdmRecordRemarks", connection); command.CommandType = CommandType.StoredProcedure; command.Parameters.Add("@Status", strStatus); command.CommandTimeout = int.Parse(ConfigurationSettings.AppSettings["SelectTimeout"]); SqlDataAdapter adapter = new SqlDataAdapter(command); adapter.Fill(ds); //ds.Tables[0].Columns.Remove("X"); if(ds.Tables[0].Rows.Count > 0) { lblErr.Text = string.Empty; dgrIdm.HeaderStyle.Font.Bold = true; dgrIdm.DataSource = ds; dgrIdm.DataBind(); DoubleGroupColumn(dgrIdm, 2); dgrIdm.Visible = true; } else { dgrIdm.Visible = false; lblErr.Text = "No Records Found"; } } catch(Exception e) { lblErr.Text = e.Message; } finally { connection.Close(); } }