HIho

i have tried all of these to read from the settings list in my program but no of them reads from it.. i think i need to some help with it please :)

//hostBox.Text = ConfigurationManager.AppSettings["Setting"].ToString();                //= ERROR
            //hostBox.Text = ConfigurationManager.AppSettings["Setting"].Get();                     //= ERROR
            //hostBox.Text = ConfigurationSettings.AppSettings["Setting"].ToString();               //= ERROR
            //hostBox.Text = ConfigurationManager.AppSettings.Get("Setting");                       //= NO RESULT
            //hostBox.Text = System.Configuration.ConfigurationSettings.AppSettings["Setting"];     //= NO RESULT
            //userBox.Text = ConfigurationManager.AppSettings["username"]; 

            Configuration config = ConfigurationManager.OpenExeConfiguration(Application.ExecutablePath); 
            ConnectionStringSettings connstr = config.ConnectionStrings.ConnectionStrings["username"]; 
            String strConn = connstr.ConnectionString;
            userBox.Text = strConn;

Im just lookin for a simple line that read and prints out my username setting (that i have added by hand)

anny one know how to fetch data from the settings?

INSERT?
DELETE?
UPDATE?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.