示例#1
0
        /// <summary>
        /// 记录服务器设置
        /// </summary>
        private void AddServer()
        {
            string file     = this.textBox_file.Text.Replace("/", "\\");
            string userpass = this.textBox_pwd.Text;

            Model.ConfigServers cs = new ConfigServers();
            cs.Name       = string.Format("{0}({1})", file, dbType.ToString());
            cs.Port       = "";
            cs.Database   = file;
            cs.file       = file;
            cs.Pwd        = this.checkBox1.Checked ? userpass : "";
            cs.ServerName = file;
            cs.Type       = dbType.ToString();
            cs.Uid        = "";
            Form_AddDatabase.AddServerToXml(cs);
        }
        /// <summary>
        /// 记录服务器设置
        /// </summary>
        private void AddServer()
        {
            string server   = this.sqlserver_server.Text;
            string userid   = this.sqlserver_uid.Text;
            string userpass = this.sqlserver_pwd.Text;

            Model.ConfigServers cs = new ConfigServers();
            cs.Name       = string.Format("{0}({1})", server, dbType.ToString());
            cs.Port       = "";
            cs.Database   = "";
            cs.file       = "";
            cs.Pwd        = this.checkBox1.Checked ? userpass : "";
            cs.ServerName = server;
            cs.Type       = dbType.ToString();
            cs.Uid        = userid;
            Form_AddDatabase.AddServerToXml(cs);
        }