private void BT_save_Click(object sender, EventArgs e)
        {
            String query = "";

            query += "INSERT INTO " + TBNM + "(" + headerTXT + ") VALUES";
            for (int k = 0; k < j; k++)
            {
                if (k % cols == 0)
                {
                    query += "(";
                }
                if (types[k % cols].Equals("int") || types[k % cols].Equals("numeric") || types[k % cols].Equals("float"))
                {
                    query += tbx[k].Text;
                }
                else
                {
                    query += "\'" + tbx[k].Text + "\'";
                }
                if (k % cols < cols - 1 && k % cols >= 0)
                {
                    query += ", ";
                }
                if (k % cols == cols - 1)
                {
                    query += "),";
                }
            }
            query = query.Remove(query.Length - 1);
            Main_Form.QueryPass(query);
            this.Close();
        }
Пример #2
0
        private void BT_OK_Click(object sender, EventArgs e)
        {
            String query = "";

            query += "CREATE TABLE " + TB_tablename.Text.ToString() + "(\n";
            for (int j = 0; j < i; j++)
            {
                query += tbx[j].Text + " " + cbx1[j].Text + "(20) " + cbx2[j].Text + ",\n";
            }
            query += "CONSTRAINT PK_" + TB_tablename.Text.ToString() + " PRIMARY KEY(" + TB_Key.Text.ToString() + "))";


            if (MessageBox.Show("테이블을 추가하시겠습니까?", "YesOrNo", MessageBoxButtons.YesNo) == DialogResult.Yes)
            {
                Main_Form.QueryPass(query);
                this.Close();
            }
            else
            {
                return;
            }
        }