Exemplo n.º 1
0
        private void button1_Click(object sender, EventArgs e)
        {
            dbconn conn          = new dbconn();
            string inFromTextbox = null;

            string[] input;
            string[] splitInput;
            string   skipun = null;

            inFromTextbox = richTextBox1.Text;
            input         = inFromTextbox.Split('\n');

            for (int i = 0; i < input.Length; i++)
            {
                splitInput = input[i].Split(' ');

                try
                {
                    skipun = ("INSERT INTO cource(nr, name, school_id, semester, units) VALUES ('" + splitInput[0] + "','" + splitInput[1] + "','" + splitInput[3] + "','2016H','" + splitInput[2] + "');");
                    conn.insert(skipun);
                }
                catch (Exception)
                {
                    MessageBox.Show(skipun);
                }
            }
            richTextBox1.Text = null;
        }
Exemplo n.º 2
0
        private void button1_Click(object sender, EventArgs e)
        {
            dbconn conn = new dbconn();
            string inFromTextbox = null;
            string[] input;
            string[] splitInput;
            string skipun = null;

            inFromTextbox = richTextBox1.Text;
            input = inFromTextbox.Split('\n');

            for (int i = 0; i < input.Length; i++)
            {
                splitInput = input[i].Split(' ');

                try
                {
                    skipun = ("INSERT INTO cource(nr, name, school_id, semester, units) VALUES ('" + splitInput[0] + "','" + splitInput[1] + "','" + splitInput[3] + "','2016H','" + splitInput[2] + "');");
                    conn.insert(skipun);
                }
                catch (Exception)
                {
                    
                    MessageBox.Show(skipun);
                }
            }
            richTextBox1.Text = null;
        }
Exemplo n.º 3
0
        private void button1_Click(object sender, EventArgs e)
        {
            dbconn conn = new dbconn();
            string inFromTextbox = null;
            string[] input;
            string[] splitInput;
            string skipun = null;

            inFromTextbox = richTextBox1.Text;
            input = inFromTextbox.Split('\n');

            for (int i = 0; i < input.Length; i++)
            {
                splitInput = input[i].Split(' ');

                skipun = ("INSERT INTO school(id, name) VALUES (" + splitInput[1] + ",'"+splitInput[0]+"');");
                conn.insert(skipun);
            }
            richTextBox1.Text = null;
        }
Exemplo n.º 4
0
        private void button1_Click(object sender, EventArgs e)
        {
            dbconn conn = new dbconn();
            string inFromTextbox = null;
            string[] input;
            string[] splitInput;
            string skipun = null;

            inFromTextbox = richTextBox1.Text;
            input = inFromTextbox.Split('\n');

            for (int i = 0; i < input.Length; i++)
            {
                splitInput = input[i].Split(' ');

                skipun = "INSERT INTO student(firstn, lastn, birthday) VALUES ('"+splitInput[0]+"','"+splitInput[1]+"','"+splitInput[2]+"');";
                conn.insert(skipun);
            }

        }
Exemplo n.º 5
0
        private void button1_Click(object sender, EventArgs e)
        {
            dbconn conn          = new dbconn();
            string inFromTextbox = null;

            string[] input;
            string[] splitInput;
            string   skipun = null;

            inFromTextbox = richTextBox1.Text;
            input         = inFromTextbox.Split('\n');

            for (int i = 0; i < input.Length; i++)
            {
                splitInput = input[i].Split(' ');

                skipun = "INSERT INTO student(firstn, lastn, birthday) VALUES ('" + splitInput[0] + "','" + splitInput[1] + "','" + splitInput[2] + "');";
                conn.insert(skipun);
            }
        }
Exemplo n.º 6
0
        private void button1_Click(object sender, EventArgs e)
        {
            dbconn conn          = new dbconn();
            string inFromTextbox = null;

            string[] input;
            string[] splitInput;
            string   skipun = null;

            inFromTextbox = richTextBox1.Text;
            input         = inFromTextbox.Split('\n');

            for (int i = 0; i < input.Length; i++)
            {
                splitInput = input[i].Split(' ');

                skipun = ("INSERT INTO school(id, name) VALUES (" + splitInput[1] + ",'" + splitInput[0] + "');");
                conn.insert(skipun);
            }
            richTextBox1.Text = null;
        }