private void reloadFields() { if (editState == EnumEditState.Ready) { editState = EnumEditState.Loading; if (ds != null) { try { if (ds.Tables.Count > 0) { if (ds.Tables[0].Rows.Count > 0) { EPField fld; FieldList flds = new FieldList(); for (int i = 0; i < ds.Tables[0].Rows.Count; i++) { if (VPLUtil.ObjectToBool(ds.Tables[0].Rows[i][1])) { fld = new EPField(); fld.Name = ds.Tables[0].Rows[i][0].ToString(); if (ds.Tables[0].Rows[i][2] != null && ds.Tables[0].Rows[i][2] != System.DBNull.Value) { fld.FieldText = ds.Tables[0].Rows[i][2].ToString(); } fld.FromTableName = ds.Tables[0].TableName; flds.AddField(fld); } } objRet.SetFields(flds); showSQL(); } } } catch (Exception er) { FormLog.NotifyException(true, er); } } editState = EnumEditState.Ready; } }