Beispiel #1
0
 private void frmItemAdder_Load(object sender, EventArgs e)
 {
     con = new DBInstance(server, database, username, password);
     db2 = new DB2();
     this.Activate();
     this.Select();
 }
        private void frmArmorSmith_Load(object sender, EventArgs e)
        {
            con = new DBInstance(server, database, username, password);
            previewBox.Visible = false;
            logoBox.Visible    = false;
            groupBox1.Visible  = false;

            bmp = new Bitmap(previewBox.Size.Width, previewBox.Size.Height);
            previewBox.Image = bmp;
            g = Graphics.FromImage(bmp);

            iconFileDataIDTxt.Text = ConfigurationManager.AppSettings["iconfiledata"];
        }
 private void ConnectionBtn_Click(object sender, EventArgs e)
 {
     con = new DBInstance(serverTxt.Text, databaseTxt.Text, usernameTxt.Text, passwordTxt.Text);
     if (con.Connected())
     {
         lblWaiting.Text = "Connecting to " + con.ConnectionString().Substring(con.ConnectionString().IndexOf('=') + 1).Substring(0, con.ConnectionString().IndexOf(';') - (con.ConnectionString().IndexOf('=')) - 1);
         con.Disconnect();
         Connection();
     }
     else
     {
         con.Connection();
         lblWaiting.Text = "Connecting to " + con.ConnectionString().Substring(con.ConnectionString().IndexOf('=') + 1).Substring(0, con.ConnectionString().IndexOf(';') - (con.ConnectionString().IndexOf('=')) - 1);
         con.Disconnect();
         Connection();
     }
 }
Beispiel #4
0
        private void frmBackupSQL_Load(object sender, EventArgs e)
        {
            con = new DBInstance(server, database, username, password);
            progressBar1.Enabled = false;
            progressBar1.Visible = false;
            label1.Visible       = false;
            label2.Visible       = false;
            label3.Visible       = false;

            this.Text = TableName;

            backgroundWorker1.DoWork                    += new DoWorkEventHandler(backgroundWorker1_DoWork);
            backgroundWorker1.RunWorkerCompleted        += new RunWorkerCompletedEventHandler(backgroundWorker1_RunWorkerCompleted);
            backgroundWorker1.ProgressChanged           += new ProgressChangedEventHandler(backgroundWorker1_ProgressChanged);
            backgroundWorker1.WorkerReportsProgress      = true;
            backgroundWorker1.WorkerSupportsCancellation = true;

            if (!backgroundWorker1.IsBusy)
            {
                backgroundWorker1.RunWorkerAsync();
            }
        }
 private void frmDB2Item_Load(object sender, EventArgs e)
 {
     con = new DBInstance(server, database, username, password);
     db2 = new DB2();
     sb  = new StringBuilder();
 }