Пример #1
0
        private void btnBack_Click(object sender, EventArgs e)
        {
            FrmListData frmList = new FrmListData();

            Hide();
            frmList.Show();
        }
Пример #2
0
        private void btnNext_Click(object sender, EventArgs e)
        {
            FrmListData frm = new FrmListData();

            this.Hide();
            frm.Show();
        }
Пример #3
0
        private void btnnext_Click(object sender, EventArgs e)
        {
            try
            {
                string conString = "Data Source=" + txtserver.Text + ";Database=" + cbbDatabase.Text + ";User Id=" + txtUsername.Text + ";Password="******"; pooling=false";

                if (!ConnectSQL.CheckConnect(conString))
                {
                    MessageBox.Show("Connect Fail");
                    return;
                }
                else
                {
                    if (chkSavepass.Checked)
                    {
                        XmlWriterSettings settings = new XmlWriterSettings();
                        settings.Indent = true;

                        XmlWriter writer = XmlWriter.Create(Path.GetDirectoryName(System.Reflection.Assembly.GetEntryAssembly().Location) + "\\configDsc.xml", settings);

                        writer.WriteStartDocument();
                        writer.WriteComment("This file is generated by the program.");
                        writer.WriteStartElement("Root");
                        writer.WriteStartElement("LVConfig");
                        writer.WriteElementString("ServerName", txtserver.Text);
                        writer.WriteElementString("UserName", txtUsername.Text);
                        writer.WriteElementString("Password", txtPassword.Text);
                        writer.WriteElementString("Database", cbbDatabase.Text);
                        writer.WriteElementString("ChkSave", chkSavepass.Checked.ToString());
                        writer.WriteEndElement();
                        writer.WriteEndElement();
                        writer.WriteEndDocument();
                        writer.Flush();
                        writer.Close();
                    }

                    FrmListData frmListTable = new FrmListData();
                    this.Hide();
                    frmListTable.Show();
                }
            }
            catch (Exception es)
            {
                MessageBox.Show("Connect Fail!");
            }
        }