Esempio n. 1
0
 private void button3_Click(object sender, EventArgs e)
 {
     ConStr = new DbConStrInfo
     {
         Server   = tb_server.Text,
         Port     = tb_port.Text,
         LogId    = tb_logid.Text,
         LogPass  = tb_logpass.Text,
         Database = cbb_db.Text,
         Provider = cbb_provider.Text
     };
     if (AppFunc.TestConnect(ConStr))
     {
         MessageBox.Show("连接数据库成功!", "提示信息");
     }
     ConStr = null;
 }
Esempio n. 2
0
 private void button1_Click(object sender, EventArgs e)
 {
     ConStr = new DbConStrInfo
     {
         Server   = tb_server.Text,
         Port     = tb_port.Text,
         LogId    = tb_logid.Text,
         LogPass  = tb_logpass.Text,
         Database = cbb_db.Text,
         Provider = cbb_provider.Text
     };
     if (!AppFunc.TestConnect(ConStr))
     {
         ConStr = null;
         return;
     }
     SaveXml("db_config.xml");
     this.DialogResult = DialogResult.OK;
 }