Exemplo n.º 1
0
        private void button1_Click(object sender, EventArgs e)
        {            
            
            string currentCopyFile = System.IO.Path.GetDirectoryName(Application.ExecutablePath) + @"\FileWriter.accdb";
            sfd.Filter = "access(*.accdb)|*.accdb";
            sfd.OverwritePrompt = true;
            dbHandler = new databaseHandler();
            if(sfd.ShowDialog()  == DialogResult.OK)
            {
                System.IO.File.Copy(currentCopyFile, sfd.FileName.ToString(), true);
                newSubject.Enabled = true;
            }
            try
            {
                dbHandler.setConnectionString(sfd.FileName.ToString());
                listTopic();

            }
            catch
            {

            }

        }
Exemplo n.º 2
0
        private void LoadSubject_Click(object sender, EventArgs e)
        {
            ofd.Filter = "All Files|*.*|Access Files|*.accdb";
            ofd.FilterIndex = 2;
            if (ofd.ShowDialog() == DialogResult.OK)
            {
                databaseHandler dbHandler = new databaseHandler();

                Console.WriteLine(ofd.FileName.ToString());

            }
        }
Exemplo n.º 3
0
 private void LoadSubject_Click(object sender, EventArgs e)
 {
     ofd.Filter = "All Files|*.*|Access Files|*.accdb";
     ofd.FilterIndex = 2;
     if (ofd.ShowDialog() == DialogResult.OK)
     {
         dbHandler = new databaseHandler();
         dbHandler.setConnectionString(ofd.FileName.ToString());
         
         listTopic();
         newSubject.Enabled = true;
     }
 }