Ejemplo n.º 1
0
        private void OpenFile(string fileName)
        {
            DAC d = new DAC(fileName);

            DBs.Add(d);

            ReLoadDBs();
        }
Ejemplo n.º 2
0
 private void SetCurrentBD(string name)
 {
     foreach (DAC d in DBs)
     {
         if (Path.GetFileName(d.FileName) == name)
         {
             currentDB = d;
         }
     }
 }
Ejemplo n.º 3
0
        private void CreateNewFile(string fileName)
        {
            DAC d = new DAC(fileName);

            d.CreateFile();

            DBs.Add(d);

            ReLoadDBs();
        }
Ejemplo n.º 4
0
        /// <summary>
        /// Run Button is pressed:
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void toolStripButton1_Click(object sender, EventArgs e)
        {
            // check for an open database
            if (currentDB == null)
            {
                if (DBs.Count == 0)
                {
                    Output("No databases connected.");
                    return;
                }

                currentDB = DBs[0];
            }

            // capture content
            string sql;

            if (rtbContent.SelectedText.Length > 0)
            {
                sql = rtbContent.SelectedText;
            }
            else
            {
                sql = rtbContent.Text;
            }

            // run query
            try
            {
                SetResults(currentDB.Run(sql));
                ReLoadDBs();
            }
            catch (Exception ex)
            {
                Output(ex.Message);
            }
        }