예제 #1
0
        void CreateDatabase_Click(object sender, EventArgs e)
        {
#if SQLSERVER
            string databaseName = IdMaxDatabase.Text.Trim(' ', '[', ']');

            string connectionString = Settings.ConnectionStringFormat(GetSqlServerAddress(),
                IdMaxUserID.Text.Trim(),
                IdMaxPassword.Text,
                "master",
                this.ThirdIsWindows.SelectedValue == "0") + "Pooling=false;";

            string result = SetupManager.CheckCreateDatabase(connectionString, databaseName);
            if (string.IsNullOrEmpty(result))
                Page.ClientScript.RegisterStartupScript(this.GetType(), "CreateDatabase_Result", "alert('数据库 " + Globals.SafeJS(databaseName) + " 创建成功');", true);
            else
                Page.ClientScript.RegisterStartupScript(this.GetType(), "CreateDatabase_Result", "alert('" + Globals.SafeJS(result) + "');", true);

            SetVisible(Step.Third);
#endif
        }
예제 #2
0
        private void createDataBase_Click(object sender, EventArgs e)
        {
#if SQLSERVER
            string databaseName     = dbName.Text.Trim(' ', '[', ']');
            string connectionString = Settings.ConnectionStringFormat(address.Text.Trim(),
                                                                      userName.Text.Trim(),
                                                                      dbPwd.Text,
                                                                      "master",
                                                                      false) + "Pooling=false;";

            string result = SetupManager.CheckCreateDatabase(connectionString, databaseName);
            if (string.IsNullOrEmpty(result))
            {
                MessageBox.Show("数据库" + databaseName + "创建成功", "安装向导", MessageBoxButtons.OK);
            }
            else
            {
                MessageBox.Show(result, "安装向导", MessageBoxButtons.OK, MessageBoxIcon.Warning);
            }
#endif
        }