private void AnalysisConnectionstring() { string tempStr = “Data Source=192.168.2.123;Initial Catalog=caxastat;Persist Security Info=True;User ID=sa;Password=sa;Pooling=true;
Max Pool Size=40000;Connect Timeout=30”; string[] paras = tempStr.Split(';'); foreach (string para in paras) { switch (para.Split('=')[0]) { case "Data Source": ServerName = para.Split('=')[1].Trim(); break; case "Initial Catalog": DataBase = para.Split('=')[1].Trim(); break; case "User ID": User = para.Split('=')[1].Trim(); break; case "Password": PassWord = para.Split('=')[1].Trim(); break; } } }