[global::System.Configuration.ApplicationScopedSettingAttribute()]
        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
        [global::System.Configuration.SpecialSettingAttribute(global::System.Configuration.SpecialSetting.ConnectionString)]
        [global::System.Configuration.DefaultSettingValueAttribute("Data Source=127.0.0.1;Initial Catalog=MatchDB;Persist Security Info=True;Us" +
            "er ID=sa;Password=sa")]
        public string  MatchDBConnectionString {
            get {
                    //下面这几句
                var connstr = "MatchDBConnectionString";//web.config里的conn名
                return System.Configuration.ConfigurationManager.ConnectionStrings[connstr].ConnectionString ??
                    ((string)(this["MatchDBConnectionString"]));
            }
        }

 

posted on 2015-01-28 11:09  松竹梅  阅读(341)  评论(0编辑  收藏  举报