private void btnSaveDBC_Click(object sender, EventArgs e) { if (!string.IsNullOrEmpty(txtDBCUsername.Text.Trim()) && !string.IsNullOrEmpty(txtDBCPassword.Text.Trim())) { BaseLib.Globals.DBCUsername = txtDBCUsername.Text; BaseLib.Globals.DBCPassword = txtDBCPassword.Text; //*** Save tb_Setting**************************/////// clsDBQueryManager objclsSettingDB = new clsDBQueryManager(); try { DataTable dt = objclsSettingDB.SelectSettingData(); foreach (DataRow row in dt.Rows) { if ("DeathByCaptcha" == row[1].ToString()) { objclsSettingDB.DeleteDBCDecaptcherData("DeathByCaptcha"); } } objclsSettingDB.InsertDBCData(StringEncoderDecoder.Encode(txtDBCUsername.Text), "DeathByCaptcha", StringEncoderDecoder.Encode(txtDBCPassword.Text)); MessageBox.Show("Settings Saved"); this.Close(); } catch (Exception ex) { Console.WriteLine(ex.StackTrace); } } else { MessageBox.Show("Please fill all Death By Captcha Details"); } }