Explorar o código

修改数据库链接方式

章政 %!s(int64=8) %!d(string=hai) anos
pai
achega
31fdcba9cf
Modificáronse 1 ficheiros con 2 adicións e 2 borrados
  1. 2 2
      UAS-MES/Login.cs

+ 2 - 2
UAS-MES/Login.cs

@@ -49,7 +49,7 @@ namespace UAS_MES
             //显示上次用户登录的用户名,将输入框定位到密码
             UserName.Text = Properties.Settings.Default.LastLoginUser;
             Source.Text = Properties.Settings.Default.LastLoginResource;
-           
+
             if (UserName.Text != "")
                 PassWord.Select();
             else
@@ -89,7 +89,7 @@ namespace UAS_MES
                     //设置屏幕的宽高信息 
                     SystemInf.ScreenWidth = Screen.PrimaryScreen.WorkingArea.Width;
                     SystemInf.ScreenHeight = Screen.PrimaryScreen.WorkingArea.Height;
-                    SystemInf.ConnectionString = "Data Source=" + DbComboxData.Rows[i]["ma_address"] + ";User ID=" + DbComboxData.Rows[i]["ma_user"] + ";PassWord=" + DbComboxData.Rows[i]["ms_pwd"];
+                    SystemInf.ConnectionString = "Connection Timeout=5;Pooling=false;Password=" + DbComboxData.Rows[i]["ms_pwd"] + ";User ID=" + DbComboxData.Rows[i]["ma_user"] + ";Pooling=false;Data Source=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=" + DbComboxData.Rows[i]["ma_address"].ToString().Split('/')[0] + ")(PORT=1521)))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=orcl)))";
                     DataHelper.DBConnectionString = SystemInf.ConnectionString;
                     //重新执行一遍构造函数使得重置之后的链接字符串生效
                     dh = new DataHelper();