private void LoadGrid(int SetID) { string ConnStr = string.Empty; string DateModFrom = string.Empty; string DateModTo = string.Empty; string ObjName = string.Empty; string DBName = string.Empty; bool FoundRow = false; string ObjectText = string.Empty; if (cbProject.Text == "") { return; } dgvMain.Rows.Clear(); using (DataStuff sn = new DataStuff()) { string ProjectName = string.Empty; ProjectName = cbProject.Text; DataTable dt = sn.GetProjectBackupSetDetail(SetID); if (dt.Rows.Count > 0) { foreach (DataRow row in dt.Rows) { if (ReleaseToServer.Trim() != "") { ConnStr = GetServerConnectionString(ReleaseToServer); ObjName = row["ObjectName"].ToString(); DBName = row["DatabaseName"].ToString(); ObjectText = row["ObjectText"].ToString(); DateModTo = LoadObjectDetail(ConnStr, DBName, "", ObjName); DateModFrom = row["HistoryDate"].ToString(); dgvMain.Rows.Add(DBName, ObjName, DateModFrom, DateModTo, true, ObjectText); FoundRow = true; } } SetDateModifiedColour(2); } } cmdRestore.Enabled = FoundRow; }