Exemplo n.º 1
0
 private void fetchAdditionalDetails(Option o)
 {
     string whereset = "", startup = "", fullval="";
     if (o.Group == "GRAPH")
     {
         txtHowset.Text = "<not applicable for Graph options>";
         txtStartup.Text = "<not applicable for Graph options>";
     }
     else
     {
         getOptionInfo(o.Name, ref whereset, ref startup, ref fullval);
         txtHowset.Text = whereset;
         txtStartup.Text = startup;
         txtCurrentValue.Text = fullval;
     }
 }
Exemplo n.º 2
0
        private void RetrieveOptionValues()
        {
            SasServer s = cmbServers.SelectedItem as SasServer;
            dServerVer = 9.2;
            string ver = s.GetSasMacroValue("SYSVER");
            try
            {
                dServerVer = Convert.ToDouble(ver);
            }
            catch { }

            using (System.Data.OleDb.OleDbConnection dbConnection = s.GetOleDbConnection())
            {

                //----- make provider connection
                dbConnection.Open();

                //----- Read values from query command
                string sql = @"select * from sashelp.vallopt order by optname";
                OleDbCommand cmdDB = new OleDbCommand(sql, dbConnection);
                OleDbDataReader dataReader = cmdDB.ExecuteReader(CommandBehavior.CloseConnection);
                try
                {
                    Options = new List<Option>();
                    while (dataReader.Read())
                    {
                        Option opt = new Option()
                        {
                            Name = dataReader["optname"].ToString(),
                            Setting = dataReader["setting"].ToString(),
                            Type = dataReader["opttype"].ToString(),
                            Description = dataReader["optdesc"].ToString(),
                            Level = dataReader["level"].ToString(),
                            Start = dServerVer > 9.2 ? dataReader["optstart"].ToString() : "",
                            Group = dataReader["group"].ToString()
                        };

                         if (opt.Level.ToUpper() == "GRAPH")
                        {
                            opt.Group = "GRAPH";
                            opt.Level = "Portable";
                            opt.Start = "OPTIONS or GOPTIONS statement";
                        }
                         switch (opt.Start.ToLower())
                        {
                            case "anytime": opt.Start = "OPTIONS statement or startup";
                                break;
                            case "startup": opt.Start = "Startup only";
                                break;
                            case "": opt.Start = opt.Start = "(requires SAS 9.3 or later to determine)";
                                break;
                            default: break;
                        };

                        Options.Add(opt);
                    }

                }

                finally
                {
                    dataReader.Close();
                    dbConnection.Close();
                }

            }
        }